53 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
54 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
55 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
56 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
57 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
58 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
59 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
60 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
61 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
62 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
63 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
64 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
80 buf[0] = (uint8_t)pack_id;
93 ((ltc_frame / 10) << 4) |
96 ((tc.tm_sec / 10) << 4) |
99 ((tc.tm_min / 10) << 4) |
103 ((tc.tm_hour / 10) << 4) |
150 ((tc.tm_mday / 10) << 4) |
153 ((tc.tm_mon / 10) << 4) |
155 buf[4] = (((tc.tm_year % 100) / 10) << 4) |
166 ((tc.tm_sec / 10) << 4) |
169 ((tc.tm_min / 10) << 4) |
172 ((tc.tm_hour / 10) << 4) |
176 buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
183 int i, j, d, of,
size;
188 for (j = 0; j < 9; j++) {
190 for (d = 8; d < 80; d+=2) {
198 frame_ptr += 16 * 80;
208 for (buf = frame; buf < frame + c->
sys->
frame_size; buf += 150 * 80) {
210 for (j = 80; j < 80 * 3; j += 80) {
211 for (k = 6; k < 6 * 8; k += 8)
223 for (j = 80*3 + 3; j < 80*6; j += 80) {
237 uint8_t*
data,
int data_size, uint8_t** frame)
254 for (i = 0; i < c->
n_ast && st != c->
ast[i]; i++);
273 for (i=0; i < c->
n_ast; i++) {
307 if (vst)
return NULL;
322 for (i=0; i<c->
n_ast; i++) {
349 for (i=0; i < c->
n_ast; i++) {
368 for (i=0; i < c->
n_ast; i++)
376 "Make sure that you supply exactly two streams:\n"
377 " video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM\n"
378 " (50Mbps allows an optional second audio stream)\n");
int av_fifo_size(AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
#define DV_MAX_FRAME_SIZE
largest possible DV frame, in bytes (1080i50)
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static int dv_write_trailer(struct AVFormatContext *s)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
AVFifoBuffer * audio_data[2]
static int dv_write_packet(struct AVFormatContext *s, AVPacket *pkt)
int audio_samples_dist[5]
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
static uint8_t * av_fifo_peek2(const AVFifoBuffer *f, int offs)
Return a pointer to the data stored in a FIFO buffer at a certain offset.
static int dv_audio_frame_size(const DVprofile *sys, int frame)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
struct tm * brktimegm(time_t secs, struct tm *tm)
static void dv_inject_audio(DVMuxContext *c, int channel, uint8_t *frame_ptr)
static int dv_assemble_frame(DVMuxContext *c, AVStream *st, uint8_t *data, int data_size, uint8_t **frame)
void av_log(void *avcl, int level, const char *fmt,...)
AVCodecContext * codec
codec context
unsigned int nb_streams
A list of all streams in the file.
int void avio_flush(AVIOContext *s)
static const int dv_aaux_packs_dist[12][9]
static void dv_inject_metadata(DVMuxContext *c, uint8_t *frame)
static DVMuxContext * dv_init_mux(AVFormatContext *s)
const DVprofile * avpriv_dv_codec_profile(AVCodecContext *codec)
struct DVMuxContext DVMuxContext
void av_fifo_free(AVFifoBuffer *f)
Free an AVFifoBuffer.
enum AVMediaType codec_type
int sample_rate
samples per second
AVOutputFormat ff_dv_muxer
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
a very simple circular buffer FIFO implementation
uint8_t frame_buf[DV_MAX_FRAME_SIZE]
static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t *buf,...)
const uint8_t(* audio_shuffle)[9]
int channels
number of audio channels
void * priv_data
Format private data.
void av_fifo_drain(AVFifoBuffer *f, int size)
Discard data from the FIFO.
static void dv_delete_mux(DVMuxContext *c)
static int dv_write_header(AVFormatContext *s)