Print the version string after the command line has been parsed.
[mplayer/glamo.git] / libmpdemux / muxer_rawvideo.c
blobb5c25aff0aa02a987dbf27f78d8f84628cd3a246
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 #include <inttypes.h>
6 #include <unistd.h>
8 #include "config.h"
9 //#include "stream/stream.h"
10 //#include "demuxer.h"
11 //#include "stheader.h"
12 #include "aviheader.h"
13 #include "ms_hdr.h"
15 #include "stream/stream.h"
16 #include "muxer.h"
18 static muxer_stream_t* rawvideofile_new_stream(muxer_t *muxer,int type){
19 muxer_stream_t* s;
20 if (!muxer) return NULL;
21 s=malloc(sizeof(muxer_stream_t));
22 memset(s,0,sizeof(muxer_stream_t));
23 if(!s) return NULL; // no mem!?
24 muxer->streams[muxer->avih.dwStreams]=s;
25 s->type=type;
26 s->id=muxer->avih.dwStreams;
27 s->timer=0.0;
28 s->size=0;
29 s->muxer=muxer;
30 switch(type){
31 case MUXER_TYPE_VIDEO:
32 s->ckid=mmioFOURCC(('0'+s->id/10),('0'+(s->id%10)),'d','c');
33 s->h.fccType=streamtypeVIDEO;
34 if(!muxer->def_v) muxer->def_v=s;
35 break;
37 muxer->avih.dwStreams++;
38 return s;
41 static void write_rawvideo_chunk(stream_t *stream,int len,void* data){
42 if(len>0){
43 if(data){
44 // DATA
45 stream_write_buffer(stream,data,len);
50 static void rawvideofile_write_chunk(muxer_stream_t *s,size_t len,unsigned int flags, double dts, double pts){
51 muxer_t *muxer=s->muxer;
53 // write out the chunk:
54 if (s->type == MUXER_TYPE_VIDEO)
55 write_rawvideo_chunk(muxer->stream,len,s->buffer); /* unsigned char */
57 // if((unsigned int)len>s->h.dwSuggestedBufferSize) s->h.dwSuggestedBufferSize=len;
61 static void rawvideofile_write_header(muxer_t *muxer){
62 return;
65 static void rawvideofile_write_index(muxer_t *muxer){
66 return;
69 int muxer_init_muxer_rawvideo(muxer_t *muxer){
70 muxer->cont_new_stream = &rawvideofile_new_stream;
71 muxer->cont_write_chunk = &rawvideofile_write_chunk;
72 muxer->cont_write_header = &rawvideofile_write_header;
73 muxer->cont_write_index = &rawvideofile_write_index;
74 return 1;