Fix non-ASCII comment
[vlc/asuraparaju-public.git] / modules / misc / stats / encoder.c
blob4b7461d17aa235d5a22f3cc4069172794976ccd3
1 /*****************************************************************************
2 * encoder.c: stats encoder plugin for vlc.
3 *****************************************************************************
4 * Copyright (C) 2002-2008 the VideoLAN team
6 * Authors: Gildas Bazin <gbazin@netcourrier.com>
7 * Pierre d'Herbemont <pdherbemont@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
25 * Preamble
26 *****************************************************************************/
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
31 #include <vlc_common.h>
32 #include <vlc_codec.h>
34 #include "stats.h"
36 /*****************************************************************************
37 * encoder_sys_t
38 *****************************************************************************/
39 struct encoder_sys_t
41 int i;
44 /*****************************************************************************
45 * Local prototypes
46 *****************************************************************************/
47 static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict );
48 static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_abuff );
50 /*****************************************************************************
51 * OpenDecoder: open the dummy encoder.
52 *****************************************************************************/
53 int OpenEncoder ( vlc_object_t *p_this )
55 encoder_t *p_enc = (encoder_t *)p_this;
57 p_enc->p_sys = malloc(sizeof(encoder_sys_t));
59 if( !p_enc->p_sys ) return VLC_ENOMEM;
61 p_enc->p_sys->i = 0;
63 msg_Dbg( p_this, "opening stats encoder" );
65 p_enc->pf_encode_video = EncodeVideo;
66 p_enc->pf_encode_audio = EncodeAudio;
69 return VLC_SUCCESS;
72 /****************************************************************************
73 * EncodeVideo: the whole thing
74 ****************************************************************************/
75 static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
77 (void)p_pict;
78 block_t * p_block = block_New( p_enc, kBufferSize );
80 *(mtime_t*)p_block->p_buffer = mdate();
81 p_block->i_buffer = kBufferSize;
82 p_block->i_length = kBufferSize;
83 p_block->i_dts = p_pict->date;
85 msg_Dbg( p_enc, "putting %"PRIu64"ms",
86 *(mtime_t*)p_block->p_buffer / 1000 );
87 return p_block;
90 /****************************************************************************
91 * EncodeVideo: the whole thing
92 ****************************************************************************/
93 static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_abuff )
95 (void)p_abuff;
96 (void)p_enc;
97 return NULL;
101 /*****************************************************************************
102 * CloseDecoder: decoder destruction
103 *****************************************************************************/
104 void CloseEncoder ( vlc_object_t *p_this )
106 encoder_t *p_enc = (encoder_t *)p_this;
108 msg_Dbg( p_this, "closing stats encoder" );
109 free( p_enc->p_sys );