annotate libmpdemux/demux_lmlm4.c @ 21223:8a52c3139152

Add support for compiling with ICC 9.1. Currently needs --target=generic-linux, since ICC does not (properly) support __attribute__((used)), even though the documentation claims otherwise.
author reimar
date Sat, 25 Nov 2006 18:00:59 +0000
parents a8e681ad7c90
children d7b2fa4c39da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
1 /*
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
2 LMLM4 MPEG4 Compression Card stream & file parser by Maxim Yevtyushkin <max@linuxmedialabs.com>
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
3 Based on SMJPEG file parser by Alex Beregszaszi
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
4
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
5 */
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
6
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
7 #include <stdio.h>
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
8 #include <stdlib.h>
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
9 #include <unistd.h>
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
10 #include <string.h> /* strtok */
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
11
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
12 #include "config.h"
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
13 #include "mp_msg.h"
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
14 #include "help_mp.h"
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
15
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
16 #include "stream.h"
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
17 #include "demuxer.h"
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
18 #include "stheader.h"
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
19 #include "bswap.h"
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
20
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
21 typedef struct __FrameInfo
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
22 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
23 ssize_t frameSize;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
24 ssize_t paddingSize;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
25 int frameType;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
26 int channelNo;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
27 } FrameInfo;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
28
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
29 #define FRAMETYPE_I 0
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
30 #define FRAMETYPE_P 1
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
31 #define FRAMETYPE_B 2
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
32 #define FRAMETYPE_AUDIO_MPEG1L2 4
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
33 #define FRAMETYPE_AUDIO_ULAW 5
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
34 #define FRAMETYPE_AUDIO_ADPCM 6
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
35
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
36 #define PACKET_BLOCK_SIZE 0x00000200
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
37 #define PACKET_BLOCK_LAST 0x000001FF
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
38 #define PACKET_BLOCK_MASK 0xFFFFFE00
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
39
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
40 #define MAX_PACKET_SIZE 1048576 // 1 Mb
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
41
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
42 #define STREAM_START_CODE_SIZE 4
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
43
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
44 /*
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
45 // codes in MSB first
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
46 static unsigned int start_code [] =
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
47 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
48 0xB0010000, // VISUAL_OBJECT_SEQUENCE_START_CODE
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
49 0xB6010000, // VOP_START_CODE
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
50 0x04C4FDFF, // MPEG1LAYERII_START_CODE
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
51 0x00000000 // end of start codes list
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
52 };
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
53 */
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
54
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
55 static int imeHeaderValid(FrameInfo *frame)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
56 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
57 if ( frame->channelNo > 7 ||
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
58 frame->frameSize > MAX_PACKET_SIZE || frame->frameSize <= 0)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
59 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
60 mp_msg(MSGT_DEMUX, MSGL_V, "Invalid packet in LMLM4 stream: ch=%d size=%d\n", frame->channelNo, frame->frameSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
61 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
62 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
63 switch (frame->frameType) {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
64 case FRAMETYPE_I:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
65 case FRAMETYPE_P:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
66 case FRAMETYPE_B:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
67 case FRAMETYPE_AUDIO_MPEG1L2:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
68 case FRAMETYPE_AUDIO_ULAW:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
69 case FRAMETYPE_AUDIO_ADPCM:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
70 break;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
71 default:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
72 mp_msg(MSGT_DEMUX, MSGL_V, "Invalid packet in LMLM4 stream (wrong packet type %d)\n", frame->frameType);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
73 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
74 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
75 return 1;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
76 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
77
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
78 /*
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
79 int searchMPEG4Stream(demuxer_t* demuxer, IME6400Header *imeHeader)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
80 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
81 void *data;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
82 ssize_t imeHeaderSize = sizeof(IME6400Header);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
83 ssize_t dataSize = sizeof(IME6400Header) * 3;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
84 ssize_t ptr = imeHeaderSize * 2;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
85 int errNo, startCodeNo;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
86 off_t pos;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
87
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
88 data = malloc(dataSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
89
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
90 imeHeaderSwap(imeHeader);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
91 memcpy(data + imeHeaderSize, imeHeader, imeHeaderSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
92
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
93 // printHex(data + imeHeaderSize, imeHeaderSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
94
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
95 while ((errNo = stream_read(demuxer->stream, data + imeHeaderSize * 2 , imeHeaderSize)) == imeHeaderSize)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
96 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
97 // printHex(data + imeHeaderSize * 2, imeHeaderSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
98
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
99 pos = stream_tell(demuxer->stream);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
100 while (dataSize - ptr >= STREAM_START_CODE_SIZE) {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
101 startCodeNo = 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
102 while (start_code[startCodeNo])
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
103 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
104 if (memcmp(&start_code[startCodeNo], data + ptr, STREAM_START_CODE_SIZE) == 0) // start code match
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
105 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
106 memcpy(imeHeader, data + ptr - imeHeaderSize, imeHeaderSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
107 imeHeaderSwap(imeHeader);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
108 if (imeHeaderValid(imeHeader))
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
109 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
110 stream_seek(demuxer->stream, pos - (dataSize - ptr));
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
111 free(data);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
112 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
113 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
114 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
115 startCodeNo++;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
116 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
117 ptr++;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
118 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
119 memcpy(data,data + imeHeaderSize, imeHeaderSize * 2);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
120 ptr -= imeHeaderSize;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
121 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
122
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
123 free(data);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
124 return errNo;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
125 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
126 */
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
127
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
128 static int getFrame(demuxer_t *demuxer, FrameInfo *frameInfo)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
129 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
130 unsigned int packetSize;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
131
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
132 frameInfo->channelNo = stream_read_word(demuxer->stream);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
133 frameInfo->frameType = stream_read_word(demuxer->stream);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
134 packetSize=stream_read_dword(demuxer->stream);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
135
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
136 if(stream_eof(demuxer->stream)){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
137 frameInfo->frameSize = 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
138 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
139 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
140
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
141 frameInfo->frameSize = packetSize - 8; //sizeof(IME6400Header);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
142 frameInfo->paddingSize = (packetSize & PACKET_BLOCK_LAST) ? PACKET_BLOCK_SIZE - (packetSize & PACKET_BLOCK_LAST) : 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
143
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
144 mp_msg(MSGT_DEMUX, MSGL_DBG2, "typ: %d chan: %d size: %d pad: %d\n",
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
145 frameInfo->frameType,
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
146 frameInfo->channelNo,
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
147 frameInfo->frameSize,
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
148 frameInfo->paddingSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
149
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
150 if(!imeHeaderValid(frameInfo)){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
151 // skip this packet
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
152 stream_skip(demuxer->stream,PACKET_BLOCK_SIZE-8);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
153 frameInfo->frameSize = 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
154 return -1;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
155 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
156
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
157 return 1;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
158 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
159
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
160 static int lmlm4_check_file(demuxer_t* demuxer)
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
161 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
162 FrameInfo frameInfo;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
163 unsigned int first;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
164
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
165 mp_msg(MSGT_DEMUX, MSGL_V, "Checking for LMLM4 Stream Format\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
166
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
167 if(getFrame(demuxer, &frameInfo)!=1){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
168 stream_skip(demuxer->stream,-8);
11790
rfelker
parents: 11590
diff changeset
169 mp_msg(MSGT_DEMUX, MSGL_V, "LMLM4 Stream Format not found\n");
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
170 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
171 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
172 first=stream_read_dword(demuxer->stream);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
173 stream_skip(demuxer->stream,-12);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
174
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
175 mp_msg(MSGT_DEMUXER,MSGL_V,"LMLM4: first=0x%08X\n",first);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
176
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
177 switch(frameInfo.frameType){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
178 case FRAMETYPE_AUDIO_MPEG1L2:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
179 if( (first & 0xffe00000) != 0xffe00000 ){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
180 mp_msg(MSGT_DEMUXER,MSGL_V,"LMLM4: not mpeg audio\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
181 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
182 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
183 if((4-((first>>17)&3))!=2){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
184 mp_msg(MSGT_DEMUXER,MSGL_V,"LMLM4: not layer-2\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
185 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
186 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
187 if(((first>>10)&0x3)==3){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
188 mp_msg(MSGT_DEMUXER,MSGL_V,"LMLM4: invalid audio sampelrate\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
189 return 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
190 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
191 mp_msg(MSGT_DEMUXER,MSGL_V,"LMLM4: first packet is audio, header checks OK!\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
192 break;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
193 // TODO: add checks for video header too, for case of disabled audio
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
194 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
195
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
196
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
197 // stream_reset(demuxer->stream);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
198 mp_msg(MSGT_DEMUX, MSGL_V, "LMLM4 Stream Format found\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
199
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
200 return DEMUXER_TYPE_LMLM4;
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
201 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
202
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
203 static int video = 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
204 static int frames= 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
205
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
206 // return value:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
207 // 0 = EOF or no stream found
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
208 // 1 = successfully read a packet
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
209 static int demux_lmlm4_fill_buffer(demuxer_t *demux, demux_stream_t *ds)
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
210 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
211 FrameInfo frameInfo;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
212 double pts;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
213 int id=1;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
214 int ret;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
215
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
216 hdr:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
217 demux->filepos = stream_tell(demux->stream);
17366
934380353fd6 massive attack: mp_msg printf format fixes
rathann
parents: 16175
diff changeset
218 mp_msg(MSGT_DEMUX, MSGL_DBG2, "fpos = %"PRId64"\n", (int64_t)demux->filepos);
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
219
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
220 ret=getFrame(demux, &frameInfo);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
221 if(ret<=0) return ret; // EOF/error
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
222
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
223 pts=demux->video->sh ? frames*((sh_video_t*)(demux->video->sh))->frametime : 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
224
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
225 switch(frameInfo.frameType){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
226 case FRAMETYPE_AUDIO_MPEG1L2:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
227 mp_dbg(MSGT_DEMUX, MSGL_DBG2, "Audio Packet\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
228 if (!video)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
229 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
230 stream_skip(demux->stream, frameInfo.frameSize + frameInfo.paddingSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
231 mp_msg(MSGT_DEMUX, MSGL_V, "Skip Audio Packet\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
232 return -1; //goto hdr;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
233 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
234 if(demux->audio->id==-1){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
235 if(!demux->a_streams[id]) new_sh_audio(demux,id);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
236 demux->audio->id=id;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
237 demux->audio->sh=demux->a_streams[id];
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
238 ((sh_audio_t*)(demux->audio->sh))->format=0x50; // mpeg audio layer 1/2
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
239 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
240 if(demux->audio->id==id)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
241 ds_read_packet(demux->audio, demux->stream, frameInfo.frameSize,
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
242 pts, demux->filepos, 0);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
243 else
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
244 stream_skip(demux->stream,frameInfo.frameSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
245 break;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
246 case FRAMETYPE_I:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
247 if (!video) {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
248 video = 1;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
249 mp_dbg(MSGT_DEMUX, MSGL_DBG2, "First Video Packet\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
250 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
251 case FRAMETYPE_P:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
252 frames=(frames+1)&(1024*1024-1); // wrap around at 4 hrs to avoid inaccurate float calculations
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
253 if (!video)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
254 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
255 stream_skip(demux->stream, frameInfo.frameSize + frameInfo.paddingSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
256 mp_msg(MSGT_DEMUX, MSGL_V, "Skip Video P Packet\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
257 return -1; //goto hdr;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
258 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
259 mp_dbg(MSGT_DEMUX, MSGL_DBG2, "Video Packet\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
260 if(demux->video->id==-1){
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
261 if(!demux->v_streams[id]) new_sh_video(demux,id);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
262 demux->video->id=id;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
263 demux->video->sh=demux->v_streams[id];
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
264 ((sh_video_t*)(demux->video->sh))->format=0x10000004; // mpeg4-ES
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
265 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
266 if(demux->video->id==id)
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
267 ds_read_packet(demux->video, demux->stream, frameInfo.frameSize,
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
268 pts, demux->filepos, 0);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
269 break;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
270 default:
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
271 stream_skip(demux->stream,frameInfo.frameSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
272 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
273
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
274 stream_skip(demux->stream, frameInfo.paddingSize);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
275
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
276 return 1;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
277 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
278
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
279 static demuxer_t* demux_open_lmlm4(demuxer_t* demuxer){
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
280 sh_audio_t *sh_audio=NULL;
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
281 sh_video_t *sh_video=NULL;
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
282
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
283 #if 0
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
284 sh_video_t* sh_video;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
285 sh_audio_t* sh_audio;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
286 unsigned int htype = 0, hleng;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
287 int i = 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
288
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
289 sh_video = new_sh_video(demuxer, 0);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
290 demuxer->video->sh = sh_video;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
291 sh_video->ds = demuxer->video;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
292 sh_video->disp_w = 640;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
293 sh_video->disp_h = 480;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
294 sh_video->format = mmioFOURCC('D','I','V','X');
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
295
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
296 sh_video->bih = malloc(sizeof(BITMAPINFOHEADER));
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
297 memset(sh_video->bih, 0, sizeof(BITMAPINFOHEADER));
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
298
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
299 /* these are false values */
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
300 sh_video->bih->biSize = 40;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
301 sh_video->bih->biWidth = sh_video->disp_w;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
302 sh_video->bih->biHeight = sh_video->disp_h;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
303 sh_video->bih->biPlanes = 3;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
304 sh_video->bih->biBitCount = 16;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
305 sh_video->bih->biCompression = sh_video->format;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
306 sh_video->bih->biSizeImage = sh_video->disp_w*sh_video->disp_h;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
307
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
308 sh_audio = new_sh_audio(demuxer, 0);
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
309 demuxer->audio->sh = sh_audio;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
310 sh_audio->ds = demuxer->audio;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
311
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
312 sh_audio->wf = malloc(sizeof(WAVEFORMATEX));
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
313 memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX));
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
314
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
315 sh_audio->samplerate = 48000;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
316 sh_audio->wf->wBitsPerSample = 16;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
317 sh_audio->channels = 2;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
318 sh_audio->format = 0x50;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
319 sh_audio->wf->wFormatTag = sh_audio->format;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
320 sh_audio->wf->nChannels = sh_audio->channels;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
321 sh_audio->wf->nSamplesPerSec = sh_audio->samplerate;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
322 sh_audio->wf->nAvgBytesPerSec = sh_audio->wf->nChannels*
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
323 sh_audio->wf->wBitsPerSample*sh_audio->wf->nSamplesPerSec/8;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
324 sh_audio->wf->nBlockAlign = sh_audio->channels *2;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
325 sh_audio->wf->cbSize = 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
326
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
327 #endif
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
328
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
329 demuxer->seekable = 0;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
330
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
331 if(!ds_fill_buffer(demuxer->video)){
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
332 mp_msg(MSGT_DEMUXER,MSGL_INFO,"LMLM4: " MSGTR_MissingVideoStream);
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
333 demuxer->video->sh=NULL;
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
334 } else {
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
335 sh_video=demuxer->video->sh;sh_video->ds=demuxer->video;
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
336 }
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
337 if(demuxer->audio->id!=-2) {
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
338 if(!ds_fill_buffer(demuxer->audio)){
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
339 mp_msg(MSGT_DEMUXER,MSGL_INFO,"LMLM4: " MSGTR_MissingAudioStream);
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
340 demuxer->audio->sh=NULL;
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
341 } else {
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
342 sh_audio=demuxer->audio->sh;sh_audio->ds=demuxer->audio;
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
343 }
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
344 }
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
345
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
346 return demuxer;
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
347 }
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
348
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
349 static void demux_close_lmlm4(demuxer_t *demuxer)
11590
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
350 {
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
351 // printf("Close LMLM4 Stream\n");
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
352 return;
0908285ada31 LML-M4 mpeg4 capture card raw stream format support
arpi
parents:
diff changeset
353 }
16175
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
354
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
355
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
356 demuxer_desc_t demuxer_desc_lmlm4 = {
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
357 "LMLM4 MPEG4 Compression Card stream demuxer",
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
358 "lmlm4",
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
359 "RAW LMLM4",
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
360 "Maxim Yevtyushkin",
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
361 "",
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
362 DEMUXER_TYPE_LMLM4,
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
363 0, // unsafe autodetect
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
364 lmlm4_check_file,
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
365 demux_lmlm4_fill_buffer,
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
366 demux_open_lmlm4,
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
367 demux_close_lmlm4,
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
368 NULL,
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
369 NULL
6b86089c2edd Demuxer modularization
rtognimp
parents: 11790
diff changeset
370 };