FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lxfdec.c
Go to the documentation of this file.
1 /*
2  * LXF demuxer
3  * Copyright (c) 2010 Tomas Härdin
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/intreadwrite.h"
23 #include "libavcodec/bytestream.h"
24 #include "avformat.h"
25 #include "internal.h"
26 
27 #define LXF_MAX_PACKET_HEADER_SIZE 256
28 #define LXF_HEADER_DATA_SIZE 120
29 #define LXF_IDENT "LEITCH\0"
30 #define LXF_IDENT_LENGTH 8
31 #define LXF_SAMPLERATE 48000
32 
33 static const AVCodecTag lxf_tags[] = {
34  { AV_CODEC_ID_MJPEG, 0 },
36  { AV_CODEC_ID_MPEG2VIDEO, 2 }, //MpMl, 4:2:0
37  { AV_CODEC_ID_MPEG2VIDEO, 3 }, //MpPl, 4:2:2
38  { AV_CODEC_ID_DVVIDEO, 4 }, //DV25
39  { AV_CODEC_ID_DVVIDEO, 5 }, //DVCPRO
40  { AV_CODEC_ID_DVVIDEO, 6 }, //DVCPRO50
41  { AV_CODEC_ID_RAWVIDEO, 7 }, //AV_PIX_FMT_ARGB, where alpha is used for chroma keying
42  { AV_CODEC_ID_RAWVIDEO, 8 }, //16-bit chroma key
43  { AV_CODEC_ID_MPEG2VIDEO, 9 }, //4:2:2 CBP ("Constrained Bytes per Gop")
44  { AV_CODEC_ID_NONE, 0 },
45 };
46 
47 typedef struct {
48  int channels; ///< number of audio channels. zero means no audio
49  int frame_number; ///< current video frame
50  uint32_t video_format, packet_type, extended_size;<