annotate libmpdemux/demux_nuv.c @ 3906:7f54bf9796c5

proper a52_init accel flags
author arpi
date Sun, 30 Dec 2001 20:32:57 +0000
parents c2792c5b4f6e
children 5e61815deced
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3801
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
1 /*
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
2 * NuppelVideo 0.05 file parser
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
3 * for MPlayer
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
4 * by Panagiotis Issaris <takis@lumumba.luc.ac.be>
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
5 *
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
6 * Reworked by alex
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
7 */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
8
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
9 #include <stdio.h>
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
10 #include <stdlib.h>
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
11 #include <unistd.h>
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
12
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
13 #include "config.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
14 #include "mp_msg.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
15 #include "help_mp.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
16 #include "stream.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
17 #include "demuxer.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
18 #include "stheader.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
19 #include "nuppelvideo.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
20 //#include "RTjpegN.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
21 //#include "minilzo.h"
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
22
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
23
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
24 struct nuv_signature
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
25 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
26 char finfo[12]; /* "NuppelVideo" + \0 */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
27 char version[5]; /* "0.05" + \0 */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
28 };
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
29
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
30
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
31 void demux_seek_nuv ( demuxer_t *demuxer, float rel_seek_secs, int flags )
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
32 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
33 }
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
34
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
35
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
36 int demux_nuv_fill_buffer ( demuxer_t *demuxer )
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
37 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
38 struct rtframeheader rtjpeg_frameheader;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
39 int orig_pos;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
40
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
41 orig_pos = stream_tell ( demuxer->stream );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
42 if (stream_read ( demuxer->stream, (char*)& rtjpeg_frameheader, sizeof ( rtjpeg_frameheader ) ) < sizeof(rtjpeg_frameheader))
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
43 return 0; /* EOF */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
44
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
45 #if 0
3811
c2792c5b4f6e audio is working
alex
parents: 3801
diff changeset
46 printf("NUV frame: frametype: %c, comptype: %c, packetlength: %d\n",
c2792c5b4f6e audio is working
alex
parents: 3801
diff changeset
47 rtjpeg_frameheader.frametype, rtjpeg_frameheader.comptype,
c2792c5b4f6e audio is working
alex
parents: 3801
diff changeset
48 rtjpeg_frameheader.packetlength);
3801
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
49 #endif
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
50
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
51 /* Skip Seekpoint, Text and Sync for now */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
52 if ((rtjpeg_frameheader.frametype == 'R') ||
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
53 (rtjpeg_frameheader.frametype == 'T') ||
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
54 (rtjpeg_frameheader.frametype == 'S'))
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
55 return 1;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
56
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
57 if (((rtjpeg_frameheader.frametype == 'D') &&
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
58 (rtjpeg_frameheader.comptype == 'R')) ||
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
59 (rtjpeg_frameheader.frametype == 'V'))
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
60 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
61 /* put RTjpeg tables, Video info to video buffer */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
62 stream_seek ( demuxer->stream, orig_pos );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
63 ds_read_packet ( demuxer->video, demuxer->stream, rtjpeg_frameheader.packetlength + 12,
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
64 rtjpeg_frameheader.timecode / 1000, orig_pos, 0 );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
65 }
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
66
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
67 /* copy PCM only */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
68 if (demuxer->audio && (rtjpeg_frameheader.frametype == 'A') &&
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
69 (rtjpeg_frameheader.comptype == '0'))
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
70 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
71 /* put Audio to audio buffer */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
72 stream_seek ( demuxer->stream, orig_pos );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
73 ds_read_packet ( demuxer->audio, demuxer->stream, rtjpeg_frameheader.packetlength + 12,
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
74 rtjpeg_frameheader.timecode / 1000, orig_pos, 0 );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
75 }
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
76
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
77 return 1;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
78 }
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
79
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
80
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
81 demuxer_t* demux_open_nuv ( demuxer_t* demuxer )
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
82 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
83 sh_video_t *sh_video = NULL;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
84 sh_audio_t *sh_audio = NULL;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
85 struct rtfileheader rtjpeg_fileheader;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
86 struct rtframeheader rtjpeg_frameheader;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
87 unsigned long int tbls[128];
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
88 int bytes_read;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
89
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
90 /* Go to the start */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
91 stream_reset(demuxer->stream);
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
92 stream_seek(demuxer->stream, 0);
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
93
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
94 stream_read ( demuxer->stream, (char*)& rtjpeg_fileheader, sizeof(rtjpeg_fileheader) );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
95
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
96 /* no video */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
97 if (rtjpeg_fileheader.videoblocks == 0)
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
98 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
99 printf("No video blocks in file\n");
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
100 return NULL;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
101 }
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
102
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
103 /* Create a new video stream header */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
104 sh_video = new_sh_video ( demuxer, 0 );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
105
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
106 /* Make sure the demuxer knows about the new video stream header
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
107 * (even though new_sh_video() ought to take care of it)
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
108 */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
109 demuxer->video->sh = sh_video;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
110
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
111 /* Make sure that the video demuxer stream header knows about its
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
112 * parent video demuxer stream (this is getting wacky), or else
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
113 * video_read_properties() will choke
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
114 */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
115 sh_video->ds = demuxer->video;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
116
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
117 /* Custom fourcc for internal MPlayer use */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
118 sh_video->format = mmioFOURCC('N', 'U', 'V', '1');
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
119
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
120 sh_video->disp_w = rtjpeg_fileheader.width;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
121 sh_video->disp_h = rtjpeg_fileheader.height;
3811
c2792c5b4f6e audio is working
alex
parents: 3801
diff changeset
122
c2792c5b4f6e audio is working
alex
parents: 3801
diff changeset
123 sh_video->aspect = (float)rtjpeg_fileheader.aspect;
3801
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
124
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
125 /* Get the FPS */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
126 sh_video->fps = rtjpeg_fileheader.fps;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
127 sh_video->frametime = 1 / sh_video->fps;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
128
3811
c2792c5b4f6e audio is working
alex
parents: 3801
diff changeset
129 #if 1
3801
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
130 if (rtjpeg_fileheader.audioblocks != 0)
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
131 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
132 sh_audio = new_sh_audio(demuxer, 0);
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
133 demuxer->audio->sh = sh_audio;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
134 sh_audio->ds = demuxer->audio;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
135 sh_audio->format = 0x1;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
136 sh_audio->channels = 2;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
137 sh_audio->samplerate = 44100;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
138
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
139 sh_audio->wf = malloc(sizeof(WAVEFORMATEX));
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
140 memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX));
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
141 sh_audio->wf->wFormatTag = sh_audio->format;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
142 sh_audio->wf->nChannels = sh_audio->channels;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
143 sh_audio->wf->wBitsPerSample = 16;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
144 sh_audio->wf->nSamplesPerSec = sh_audio->samplerate;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
145 sh_audio->wf->nAvgBytesPerSec = sh_audio->wf->nChannels*
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
146 sh_audio->wf->wBitsPerSample*sh_audio->wf->nSamplesPerSec/8;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
147 sh_audio->wf->nBlockAlign = sh_audio->channels * 2;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
148 sh_audio->wf->cbSize = 0;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
149 }
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
150 #endif
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
151
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
152 return demuxer;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
153 }
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
154
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
155 int nuv_check_file ( demuxer_t* demuxer )
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
156 {
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
157 struct nuv_signature ns;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
158
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
159 /* Store original position */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
160 int orig_pos = stream_tell(demuxer->stream);
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
161
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
162 mp_msg ( MSGT_DEMUX, MSGL_V, "Checking for NuppelVideo\n" );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
163
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
164 stream_read(demuxer->stream,(char*)&ns,sizeof(ns));
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
165
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
166 if ( strncmp ( ns.finfo, "NuppelVideo", 12 ) )
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
167 return 0; /* Not a NuppelVideo file */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
168 if ( strncmp ( ns.version, "0.05", 5 ) )
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
169 return 0; /* Wrong version NuppelVideo file */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
170
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
171 /* Return to original position */
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
172 stream_seek ( demuxer->stream, orig_pos );
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
173 return 1;
3cea69dda1b3 added NuppelVideo demuxer, based on Panagiotis Issaris' patch
alex
parents:
diff changeset
174 }