]> git.sesse.net Git - vlc/blob - modules/misc/stats/encoder.c
macosx: fixed menubar appearance in fullscreen mode by partially reverting [46c93c9cc...
[vlc] / modules / misc / stats / encoder.c
1 /*****************************************************************************
2  * encoder.c: stats encoder plugin for vlc.
3  *****************************************************************************
4  * Copyright (C) 2002-2008 the VideoLAN team
5  *
6  * Authors: Gildas Bazin <gbazin@netcourrier.com>
7  *          Pierre d'Herbemont <pdherbemont@videolan.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32 #include <vlc_codec.h>
33 #include <vlc_vout.h>
34
35 #include "stats.h"
36
37 /*****************************************************************************
38  * encoder_sys_t
39  *****************************************************************************/
40 struct encoder_sys_t
41 {
42     int i;
43 };
44
45 /*****************************************************************************
46  * Local prototypes
47  *****************************************************************************/
48 static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict );
49 static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_abuff );
50
51 /*****************************************************************************
52  * OpenDecoder: open the dummy encoder.
53  *****************************************************************************/
54 int OpenEncoder ( vlc_object_t *p_this )
55 {
56     encoder_t *p_enc = (encoder_t *)p_this;
57
58     p_enc->p_sys = malloc(sizeof(encoder_sys_t));
59
60     if( !p_enc->p_sys ) return VLC_ENOMEM;
61
62     p_enc->p_sys->i = 0;
63
64     msg_Dbg( p_this, "opening stats encoder" );
65
66     p_enc->pf_encode_video = EncodeVideo;
67     p_enc->pf_encode_audio = EncodeAudio;
68
69
70     return VLC_SUCCESS;
71 }
72
73 /****************************************************************************
74  * EncodeVideo: the whole thing
75  ****************************************************************************/
76 static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
77 {
78     (void)p_pict;
79     block_t * p_block = block_New( p_enc, kBufferSize );
80
81     *(mtime_t*)p_block->p_buffer = mdate();
82     p_block->i_buffer = kBufferSize;
83     p_block->i_length = kBufferSize;
84     p_block->i_dts = p_pict->date;
85
86     msg_Dbg( p_enc, "putting %"PRIu64"ms",
87              *(mtime_t*)p_block->p_buffer / 1000 );
88     return p_block;
89 }
90
91 /****************************************************************************
92  * EncodeVideo: the whole thing
93  ****************************************************************************/
94 static block_t *EncodeAudio( encoder_t *p_enc, aout_buffer_t *p_abuff )
95 {
96     (void)p_abuff;
97     (void)p_enc;
98     return NULL;
99 }
100
101
102 /*****************************************************************************
103  * CloseDecoder: decoder destruction
104  *****************************************************************************/
105 void CloseEncoder ( vlc_object_t *p_this )
106 {
107     encoder_t *p_enc = (encoder_t *)p_this;
108
109     msg_Dbg( p_this, "closing stats encoder" );
110     free( p_enc->p_sys );
111 }