Mercurial > libavformat.hg
comparison dvenc.c @ 3968:bf1b4748cd2e libavformat
spelling cosmetics
author | diego |
---|---|
date | Thu, 02 Oct 2008 16:28:58 +0000 |
parents | e6aeb2733e34 |
children | 36f92f77c85e |
comparison
equal
deleted
inserted
replaced
3967:4fd67f05bad9 | 3968:bf1b4748cd2e |
---|---|
36 | 36 |
37 struct DVMuxContext { | 37 struct DVMuxContext { |
38 const DVprofile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */ | 38 const DVprofile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */ |
39 int n_ast; /* Number of stereo audio streams (up to 2) */ | 39 int n_ast; /* Number of stereo audio streams (up to 2) */ |
40 AVStream *ast[2]; /* Stereo audio streams */ | 40 AVStream *ast[2]; /* Stereo audio streams */ |
41 AVFifoBuffer audio_data[2]; /* Fifo for storing excessive amounts of PCM */ | 41 AVFifoBuffer audio_data[2]; /* FIFO for storing excessive amounts of PCM */ |
42 int frames; /* Number of a current frame */ | 42 int frames; /* Number of a current frame */ |
43 time_t start_time; /* Start time of recording */ | 43 time_t start_time; /* Start time of recording */ |
44 int has_audio; /* frame under contruction has audio */ | 44 int has_audio; /* frame under contruction has audio */ |
45 int has_video; /* frame under contruction has video */ | 45 int has_video; /* frame under contruction has video */ |
46 uint8_t frame_buf[DV_MAX_FRAME_SIZE]; /* frame under contruction */ | 46 uint8_t frame_buf[DV_MAX_FRAME_SIZE]; /* frame under contruction */ |
115 (1 << 6) | /* multi-language flag */ | 115 (1 << 6) | /* multi-language flag */ |
116 (c->sys->dsf << 5) | /* system: 60fields/50fields */ | 116 (c->sys->dsf << 5) | /* system: 60fields/50fields */ |
117 (c->sys->n_difchan & 2); /* definition: 0 -- 25Mbps, 2 -- 50Mbps */ | 117 (c->sys->n_difchan & 2); /* definition: 0 -- 25Mbps, 2 -- 50Mbps */ |
118 buf[4] = (1 << 7) | /* emphasis: 1 -- off */ | 118 buf[4] = (1 << 7) | /* emphasis: 1 -- off */ |
119 (0 << 6) | /* emphasis time constant: 0 -- reserved */ | 119 (0 << 6) | /* emphasis time constant: 0 -- reserved */ |
120 (0 << 3) | /* frequency: 0 -- 48Khz, 1 -- 44,1Khz, 2 -- 32Khz */ | 120 (0 << 3) | /* frequency: 0 -- 48kHz, 1 -- 44,1kHz, 2 -- 32kHz */ |
121 0; /* quantization: 0 -- 16bit linear, 1 -- 12bit nonlinear */ | 121 0; /* quantization: 0 -- 16bit linear, 1 -- 12bit nonlinear */ |
122 va_end(ap); | 122 va_end(ap); |
123 break; | 123 break; |
124 case dv_audio_control: | 124 case dv_audio_control: |
125 buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */ | 125 buf[1] = (0 << 6) | /* copy protection: 0 -- unrestricted */ |
187 for (d = 8; d < 80; d+=2) { | 187 for (d = 8; d < 80; d+=2) { |
188 of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride; | 188 of = c->sys->audio_shuffle[i][j] + (d - 8)/2 * c->sys->audio_stride; |
189 if (of*2 >= size) | 189 if (of*2 >= size) |
190 continue; | 190 continue; |
191 | 191 |
192 frame_ptr[d] = av_fifo_peek(&c->audio_data[channel], of*2+1); // FIXME: may be we have to admit | 192 frame_ptr[d] = av_fifo_peek(&c->audio_data[channel], of*2+1); // FIXME: maybe we have to admit |
193 frame_ptr[d+1] = av_fifo_peek(&c->audio_data[channel], of*2); // that DV is a big endian PCM | 193 frame_ptr[d+1] = av_fifo_peek(&c->audio_data[channel], of*2); // that DV is a big-endian PCM |
194 } | 194 } |
195 frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */ | 195 frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */ |
196 } | 196 } |
197 } | 197 } |
198 } | 198 } |
363 static int dv_write_header(AVFormatContext *s) | 363 static int dv_write_header(AVFormatContext *s) |
364 { | 364 { |
365 if (!dv_init_mux(s)) { | 365 if (!dv_init_mux(s)) { |
366 av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n" | 366 av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n" |
367 "Make sure that you supply exactly two streams:\n" | 367 "Make sure that you supply exactly two streams:\n" |
368 " video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM\n" | 368 " video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM\n" |
369 " (50Mbps allows an optional second audio stream)\n"); | 369 " (50Mbps allows an optional second audio stream)\n"); |
370 return -1; | 370 return -1; |
371 } | 371 } |
372 return 0; | 372 return 0; |
373 } | 373 } |