author | zecke <zecke> | 2002-07-09 13:49:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-09 13:49:34 (UTC) |
commit | 87bb55055c826b6c75d4a66a7ff6e21058cf6361 (patch) (unidiff) | |
tree | 000f68448ce3b903da00a3e5a2ad24140a18f85b | |
parent | e99adc2029808f6276474c95e8587607a4bd8091 (diff) | |
download | opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.zip opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.tar.gz opie-87bb55055c826b6c75d4a66a7ff6e21058cf6361.tar.bz2 |
Update the lib
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 40 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.h | 47 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 37 |
3 files changed, 119 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 0ea85dd..69ff492 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -1,119 +1,153 @@ | |||
1 | 1 | ||
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | //#include <qpe/qpeapplication.h> | 4 | //#include <qpe/qpeapplication.h> |
5 | 5 | ||
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | 7 | ||
8 | #include "frame.h" | 8 | #include "frame.h" |
9 | #include "lib.h" | 9 | #include "lib.h" |
10 | 10 | ||
11 | 11 | ||
12 | extern "C" { | 12 | extern "C" { |
13 | vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); | 13 | vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); |
14 | int null_is_showing_video( vo_driver_t* self ); | ||
15 | void null_set_show_video( vo_driver_t* self, int show ); | ||
16 | int null_is_fullscreen( vo_driver_t* self ); | ||
17 | void null_set_fullscreen( vo_driver_t* self, int screen ); | ||
18 | int null_is_scaling( vo_driver_t* self ); | ||
19 | void null_set_scaling( vo_driver_t* self, int scale ); | ||
20 | |||
14 | } | 21 | } |
15 | 22 | ||
16 | using namespace XINE; | 23 | using namespace XINE; |
17 | 24 | ||
18 | Lib::Lib() { | 25 | Lib::Lib() { |
19 | printf("Lib"); | 26 | printf("Lib"); |
20 | QCString str( getenv("HOME") ); | 27 | QCString str( getenv("HOME") ); |
21 | str += "/Settings/opiexine.cf"; | 28 | str += "/Settings/opiexine.cf"; |
22 | // get the configuration | 29 | // get the configuration |
23 | m_config = xine_config_file_init( str.data() ); | 30 | m_config = xine_config_file_init( str.data() ); |
24 | 31 | ||
25 | // allocate oss for sound | 32 | // allocate oss for sound |
26 | // and fb for framebuffer | 33 | // and fb for framebuffer |
27 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; | 34 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; |
28 | if (m_audioOutput == NULL ) | 35 | if (m_audioOutput == NULL ) |
29 | printf("Failure\n"); | 36 | printf("Failure\n"); |
30 | else | 37 | else |
31 | printf("Success\n"); | 38 | printf("Success\n"); |
32 | 39 | ||
33 | 40 | ||
34 | // test code | 41 | // test code |
35 | m_videoOutput = xine_load_video_output_plugin(m_config, "fb", | 42 | m_videoOutput = xine_load_video_output_plugin(m_config, "fb", |
36 | VISUAL_TYPE_FB, | 43 | VISUAL_TYPE_FB, |
37 | 0 ); | 44 | 0 ); |
38 | 45 | ||
39 | char** files = xine_list_video_output_plugins(3); | 46 | char** files = xine_list_video_output_plugins(3); |
40 | char* out; | 47 | char* out; |
41 | int i = 0; | 48 | int i = 0; |
42 | while ( ( out = files[i] ) != 0 ) { | 49 | while ( ( out = files[i] ) != 0 ) { |
43 | printf("Audio %s\n", out ); | 50 | printf("Audio %s\n", out ); |
44 | i++; | 51 | i++; |
45 | } | 52 | } |
46 | // m_xine = xine_init( m_videoOutput, | 53 | // m_xine = xine_init( m_videoOutput, |
47 | // m_audioOutput, | 54 | // m_audioOutput, |
48 | // m_config ); | 55 | // m_config ); |
49 | // test loading | 56 | // test loading |
50 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); | 57 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); |
51 | m_xine = xine_init( m_videoOutput, | 58 | m_xine = xine_init( m_videoOutput, |
52 | m_audioOutput, m_config ); | 59 | m_audioOutput, m_config ); |
60 | // install the event handler | ||
61 | xine_register_event_listener( m_xine, xine_event_handler, this ); | ||
53 | } | 62 | } |
54 | 63 | ||
55 | Lib::~Lib() { | 64 | Lib::~Lib() { |
56 | delete m_config; | 65 | delete m_config; |
66 | xine_remove_event_listener( m_xine, xine_event_handler ); | ||
57 | xine_exit( m_xine ); | 67 | xine_exit( m_xine ); |
58 | delete m_videoOutput; | 68 | delete m_videoOutput; |
59 | //delete m_audioOutput; | 69 | //delete m_audioOutput; |
60 | 70 | ||
61 | } | 71 | } |
62 | 72 | ||
63 | QCString Lib::version() { | 73 | QCString Lib::version() { |
64 | QCString str( xine_get_str_version() ); | 74 | QCString str( xine_get_str_version() ); |
65 | return str; | 75 | return str; |
66 | }; | 76 | }; |
67 | 77 | ||
68 | int Lib::majorVersion() { | 78 | int Lib::majorVersion() { |
69 | return xine_get_major_version(); | 79 | return xine_get_major_version(); |
70 | } | 80 | } |
71 | int Lib::minorVersion() { | 81 | int Lib::minorVersion() { |
72 | return xine_get_minor_version(); | 82 | return xine_get_minor_version(); |
73 | }; | 83 | }; |
74 | 84 | ||
75 | int Lib::subVersion() { | 85 | int Lib::subVersion() { |
76 | return xine_get_sub_version(); | 86 | return xine_get_sub_version(); |
77 | } | 87 | } |
78 | int Lib::play( const QString& fileName, | 88 | int Lib::play( const QString& fileName, |
79 | int startPos, | 89 | int startPos, |
80 | int start_time ) { | 90 | int start_time ) { |
81 | QString str = fileName; | 91 | QString str = fileName; |
82 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), | 92 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), |
83 | startPos, start_time); | 93 | startPos, start_time); |
84 | } | 94 | } |
85 | void Lib::stop() { | 95 | void Lib::stop() { |
86 | xine_stop(m_xine ); | 96 | xine_stop(m_xine ); |
87 | } | 97 | } |
88 | void Lib::pause(){ | 98 | void Lib::pause(){ |
89 | xine_set_speed( m_xine, SPEED_PAUSE ); | 99 | xine_set_speed( m_xine, SPEED_PAUSE ); |
90 | } | 100 | } |
91 | int Lib::speed() { | 101 | int Lib::speed() { |
92 | return xine_get_speed( m_xine ); | 102 | return xine_get_speed( m_xine ); |
93 | } | 103 | } |
94 | void Lib::setSpeed( int speed ) { | 104 | void Lib::setSpeed( int speed ) { |
95 | xine_set_speed( m_xine, speed ); | 105 | xine_set_speed( m_xine, speed ); |
96 | } | 106 | } |
97 | int Lib::status(){ | 107 | int Lib::status(){ |
98 | return xine_get_status( m_xine ); | 108 | return xine_get_status( m_xine ); |
99 | } | 109 | } |
100 | int Lib::currentPosition(){ | 110 | int Lib::currentPosition(){ |
101 | return xine_get_current_position( m_xine ); | 111 | return xine_get_current_position( m_xine ); |
102 | } | 112 | } |
103 | int Lib::currentTime() { | 113 | int Lib::currentTime() { |
104 | return xine_get_current_time( m_xine ); | 114 | return xine_get_current_time( m_xine ); |
105 | }; | 115 | }; |
106 | int Lib::length() { | 116 | int Lib::length() { |
107 | return xine_get_stream_length( m_xine ); | 117 | return xine_get_stream_length( m_xine ); |
108 | } | 118 | } |
109 | bool Lib::isSeekable() { | 119 | bool Lib::isSeekable() { |
110 | return xine_is_stream_seekable(m_xine); | 120 | return xine_is_stream_seekable(m_xine); |
111 | } | 121 | } |
112 | Frame Lib::currentFrame() { | 122 | Frame Lib::currentFrame() { |
113 | Frame frame; | 123 | Frame frame; |
114 | return frame; | 124 | return frame; |
115 | }; | 125 | }; |
116 | int Lib::error() { | 126 | int Lib::error() { |
117 | return xine_get_error( m_xine ); | 127 | return xine_get_error( m_xine ); |
118 | }; | 128 | }; |
119 | 129 | void Lib::handleXineEvent( xine_event_t* t ) { | |
130 | if ( t->type == XINE_EVENT_PLAYBACK_FINISHED ) | ||
131 | emit stopped(); | ||
132 | } | ||
133 | void Lib::setShowVideo( bool video ) { | ||
134 | ::null_set_show_video( m_videoOutput, video ); | ||
135 | } | ||
136 | bool Lib::isShowingVideo() { | ||
137 | return ::null_is_showing_video( m_videoOutput ); | ||
138 | } | ||
139 | void Lib::showVideoFullScreen( bool fullScreen ) { | ||
140 | ::null_set_fullscreen( m_videoOutput, fullScreen ); | ||
141 | } | ||
142 | bool Lib::isVideoFullScreen() { | ||
143 | return ::null_is_fullscreen( m_videoOutput ); | ||
144 | } | ||
145 | void Lib::setScaling( bool scale ) { | ||
146 | ::null_set_scaling( m_videoOutput, scale ); | ||
147 | } | ||
148 | bool Lib::isScaling() { | ||
149 | return ::null_is_scaling( m_videoOutput ); | ||
150 | } | ||
151 | void Lib::xine_event_handler( void* user_data, xine_event_t* t ) { | ||
152 | ((Lib*)user_data)->handleXineEvent( t ); | ||
153 | } | ||
diff --git a/noncore/multimedia/opieplayer2/lib.h b/noncore/multimedia/opieplayer2/lib.h index d9dc931..00a1248 100644 --- a/noncore/multimedia/opieplayer2/lib.h +++ b/noncore/multimedia/opieplayer2/lib.h | |||
@@ -1,60 +1,105 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #ifndef ZECKEXINELIB_H | 3 | #ifndef ZECKEXINELIB_H |
4 | #define ZECKEXINELIB_H | 4 | #define ZECKEXINELIB_H |
5 | 5 | ||
6 | #include <qcstring.h> | 6 | #include <qcstring.h> |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | #include <qobject.h> | ||
9 | |||
8 | #include <xine.h> | 10 | #include <xine.h> |
9 | 11 | ||
10 | namespace XINE { | 12 | namespace XINE { |
11 | 13 | ||
12 | /** | 14 | /** |
13 | * Lib wrapps the simple interface | 15 | * Lib wrapps the simple interface |
14 | * of libxine for easy every day use | 16 | * of libxine for easy every day use |
15 | * This will become a full C++ Wrapper | 17 | * This will become a full C++ Wrapper |
16 | * It supports playing, pausing, info, | 18 | * It supports playing, pausing, info, |
17 | * stooping, seeking. | 19 | * stooping, seeking. |
18 | */ | 20 | */ |
19 | class Frame; | 21 | class Frame; |
20 | class Lib { | 22 | class Lib : public QObject { |
23 | Q_OBJECT | ||
21 | public: | 24 | public: |
22 | Lib(); | 25 | Lib(); |
23 | ~Lib(); | 26 | ~Lib(); |
24 | QCString version(); | 27 | QCString version(); |
25 | int majorVersion()/*const*/; | 28 | int majorVersion()/*const*/; |
26 | int minorVersion()/*const*/; | 29 | int minorVersion()/*const*/; |
27 | int subVersion()/*const*/; | 30 | int subVersion()/*const*/; |
28 | 31 | ||
29 | 32 | ||
30 | int play( const QString& fileName, | 33 | int play( const QString& fileName, |
31 | int startPos = 0, | 34 | int startPos = 0, |
32 | int start_time = 0 ); | 35 | int start_time = 0 ); |
33 | void stop() /*const*/; | 36 | void stop() /*const*/; |
34 | void pause()/*const*/; | 37 | void pause()/*const*/; |
35 | 38 | ||
36 | int speed() /*const*/; | 39 | int speed() /*const*/; |
37 | void setSpeed( int speed = SPEED_PAUSE ); | 40 | void setSpeed( int speed = SPEED_PAUSE ); |
38 | 41 | ||
39 | int status() /*const*/; | 42 | int status() /*const*/; |
40 | 43 | ||
41 | int currentPosition()/*const*/; | 44 | int currentPosition()/*const*/; |
42 | //in seconds | 45 | //in seconds |
43 | int currentTime()/*const*/; | 46 | int currentTime()/*const*/; |
44 | int length() /*const*/; | 47 | int length() /*const*/; |
45 | 48 | ||
46 | bool isSeekable()/*const*/; | 49 | bool isSeekable()/*const*/; |
47 | 50 | ||
51 | /** | ||
52 | * Whether or not to show video output | ||
53 | */ | ||
54 | void setShowVideo(bool video); | ||
55 | |||
56 | /** | ||
57 | * is we show video | ||
58 | */ | ||
59 | bool isShowingVideo() /*const*/; | ||
60 | |||
61 | /** | ||
62 | * | ||
63 | */ | ||
64 | void showVideoFullScreen( bool fullScreen ); | ||
65 | |||
66 | /** | ||
67 | * | ||
68 | */ | ||
69 | bool isVideoFullScreen()/*const*/ ; | ||
70 | |||
71 | /** | ||
72 | * | ||
73 | */ | ||
74 | bool isScaling(); | ||
75 | |||
76 | /** | ||
77 | * | ||
78 | */ | ||
79 | void setScaling( bool ); | ||
80 | /** | ||
81 | * test | ||
82 | */ | ||
48 | Frame currentFrame()/*const*/; | 83 | Frame currentFrame()/*const*/; |
84 | |||
85 | /** | ||
86 | * Returns the error code | ||
87 | */ | ||
49 | int error() /*const*/; | 88 | int error() /*const*/; |
89 | |||
90 | signals: | ||
91 | void stopped(); | ||
50 | private: | 92 | private: |
51 | xine_t *m_xine; | 93 | xine_t *m_xine; |
52 | config_values_t *m_config; | 94 | config_values_t *m_config; |
53 | vo_driver_t *m_videoOutput; | 95 | vo_driver_t *m_videoOutput; |
54 | ao_driver_t* m_audioOutput; | 96 | ao_driver_t* m_audioOutput; |
55 | 97 | ||
98 | void handleXineEvent( xine_event_t* t ); | ||
99 | // C -> C++ bridge for the event system | ||
100 | static void xine_event_handler( void* user_data, xine_event_t* t); | ||
56 | }; | 101 | }; |
57 | }; | 102 | }; |
58 | 103 | ||
59 | 104 | ||
60 | #endif | 105 | #endif |
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index 5224862..b8b8eb3 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -1,183 +1,218 @@ | |||
1 | 1 | ||
2 | /*#include <xine.h>*/ | 2 | /*#include <xine.h>*/ |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | 5 | ||
6 | #include <xine/video_out.h> | 6 | #include <xine/video_out.h> |
7 | #include <xine/xine_internal.h> | 7 | #include <xine/xine_internal.h> |
8 | #include <xine/xineutils.h> | 8 | #include <xine/xineutils.h> |
9 | #include <xine/configfile.h> | 9 | #include <xine/configfile.h> |
10 | 10 | ||
11 | typedef struct null_driver_s null_driver_t; | 11 | typedef struct null_driver_s null_driver_t; |
12 | 12 | ||
13 | struct null_driver_s { | 13 | struct null_driver_s { |
14 | vo_driver_t vo_driver; | 14 | vo_driver_t vo_driver; |
15 | uint32_t m_capabilities; | 15 | uint32_t m_capabilities; |
16 | 16 | int m_show_video; | |
17 | int m_video_fullscreen; | ||
18 | int m_is_scaling; | ||
17 | }; | 19 | }; |
18 | typedef struct opie_frame_s opie_frame_t; | 20 | typedef struct opie_frame_s opie_frame_t; |
19 | struct opie_frame_s { | 21 | struct opie_frame_s { |
20 | vo_frame_t frame; | 22 | vo_frame_t frame; |
21 | char* name; | 23 | char* name; |
22 | int version; | 24 | int version; |
23 | int m_width; | 25 | int m_width; |
24 | int m_height; | 26 | int m_height; |
25 | uint8_t *chunk[3]; | 27 | uint8_t *chunk[3]; |
26 | null_driver_t *output; | 28 | null_driver_t *output; |
27 | }; | 29 | }; |
28 | 30 | ||
29 | static uint32_t null_get_capabilities(vo_driver_t *self ){ | 31 | static uint32_t null_get_capabilities(vo_driver_t *self ){ |
30 | null_driver_t* this = (null_driver_t*)self; | 32 | null_driver_t* this = (null_driver_t*)self; |
31 | printf("capabilities\n"); | 33 | printf("capabilities\n"); |
32 | return this->m_capabilities; | 34 | return this->m_capabilities; |
33 | } | 35 | } |
34 | 36 | ||
35 | /* take care of the frame*/ | 37 | /* take care of the frame*/ |
36 | static void null_frame_dispose( vo_frame_t* vo_img){ | 38 | static void null_frame_dispose( vo_frame_t* vo_img){ |
37 | opie_frame_t* frame = (opie_frame_t*)vo_img; | 39 | opie_frame_t* frame = (opie_frame_t*)vo_img; |
38 | printf("frame_dispose\n"); | 40 | printf("frame_dispose\n"); |
39 | free (frame); | 41 | free (frame); |
40 | } | 42 | } |
41 | static void null_frame_field( vo_frame_t* frame, int inti ){ | 43 | static void null_frame_field( vo_frame_t* frame, int inti ){ |
42 | printf("frame_field\n"); | 44 | printf("frame_field\n"); |
43 | /* not needed */ | 45 | /* not needed */ |
44 | } | 46 | } |
45 | 47 | ||
46 | /* end take care of frames*/ | 48 | /* end take care of frames*/ |
47 | 49 | ||
48 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | 50 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ |
49 | null_driver_t* this = (null_driver_t*)self; | 51 | null_driver_t* this = (null_driver_t*)self; |
50 | opie_frame_t* frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); | 52 | opie_frame_t* frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); |
51 | memset( frame, 0, sizeof( opie_frame_t) ); | 53 | memset( frame, 0, sizeof( opie_frame_t) ); |
52 | printf("alloc_frame\n"); | 54 | printf("alloc_frame\n"); |
53 | frame->name = "opie\0"; | 55 | frame->name = "opie\0"; |
54 | frame->version = 1; | 56 | frame->version = 1; |
55 | frame->output = this; | 57 | frame->output = this; |
56 | 58 | ||
57 | /* initialize the frame*/ | 59 | /* initialize the frame*/ |
58 | frame->frame.driver = self; | 60 | frame->frame.driver = self; |
59 | /*frame.frame.free = null_frame_free;*/ | 61 | /*frame.frame.free = null_frame_free;*/ |
60 | frame->frame.copy = NULL; | 62 | frame->frame.copy = NULL; |
61 | frame->frame.field = null_frame_field; | 63 | frame->frame.field = null_frame_field; |
62 | frame->frame.dispose = null_frame_dispose; | 64 | frame->frame.dispose = null_frame_dispose; |
63 | 65 | ||
64 | 66 | ||
65 | return (vo_frame_t*) frame; | 67 | return (vo_frame_t*) frame; |
66 | } | 68 | } |
67 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | 69 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, |
68 | uint32_t width, uint32_t height, | 70 | uint32_t width, uint32_t height, |
69 | int ratio_code, int format, int flags ){ | 71 | int ratio_code, int format, int flags ){ |
70 | null_driver_t* this = (null_driver_t*) self; | 72 | null_driver_t* this = (null_driver_t*) self; |
71 | opie_frame_t* frame = (opie_frame_t*)img; | 73 | opie_frame_t* frame = (opie_frame_t*)img; |
72 | /* not needed now */ | 74 | /* not needed now */ |
73 | printf("update_frame_format\n"); | 75 | printf("update_frame_format\n"); |
74 | printf("al crash aye?\n"); | 76 | printf("al crash aye?\n"); |
75 | 77 | ||
76 | if(frame->chunk[0] ){ | 78 | if(frame->chunk[0] ){ |
77 | free( frame->chunk[0] ); | 79 | free( frame->chunk[0] ); |
78 | frame->chunk[0] = NULL; | 80 | frame->chunk[0] = NULL; |
79 | } | 81 | } |
80 | if(frame->chunk[1] ){ | 82 | if(frame->chunk[1] ){ |
81 | free ( frame->chunk[1] ); | 83 | free ( frame->chunk[1] ); |
82 | frame->chunk[1] = NULL; | 84 | frame->chunk[1] = NULL; |
83 | } | 85 | } |
84 | if(frame->chunk[2] ){ | 86 | if(frame->chunk[2] ){ |
85 | free ( frame->chunk[2] ); | 87 | free ( frame->chunk[2] ); |
86 | frame->chunk[2] = NULL; | 88 | frame->chunk[2] = NULL; |
87 | } | 89 | } |
88 | 90 | ||
89 | 91 | ||
90 | if( format == IMGFMT_YV12 ) { | 92 | if( format == IMGFMT_YV12 ) { |
91 | int image_size = width * height; /* cast ouch*/ | 93 | int image_size = width * height; /* cast ouch*/ |
92 | frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, | 94 | frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, |
93 | (void **)&frame->chunk[0] ); | 95 | (void **)&frame->chunk[0] ); |
94 | frame->frame.base[1] = xine_xmalloc_aligned(16, image_size, | 96 | frame->frame.base[1] = xine_xmalloc_aligned(16, image_size, |
95 | (void **)&frame->chunk[1] ); | 97 | (void **)&frame->chunk[1] ); |
96 | frame->frame.base[2] = xine_xmalloc_aligned(16, image_size, | 98 | frame->frame.base[2] = xine_xmalloc_aligned(16, image_size, |
97 | (void **)&frame->chunk[2] ); | 99 | (void **)&frame->chunk[2] ); |
98 | }else{ | 100 | }else{ |
99 | int image_size = width * height; /* cast ouch*/ | 101 | int image_size = width * height; /* cast ouch*/ |
100 | frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, | 102 | frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, |
101 | (void **)&frame->chunk[0] ); | 103 | (void **)&frame->chunk[0] ); |
102 | frame->chunk[1] = NULL; | 104 | frame->chunk[1] = NULL; |
103 | frame->chunk[2] = NULL; | 105 | frame->chunk[2] = NULL; |
104 | } | 106 | } |
105 | 107 | ||
106 | } | 108 | } |
107 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ | 109 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ |
108 | printf("display frame\n"); | 110 | printf("display frame\n"); |
109 | } | 111 | } |
110 | static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, | 112 | static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, |
111 | vo_overlay_t* overlay ){ | 113 | vo_overlay_t* overlay ){ |
112 | /* sure */ | 114 | /* sure */ |
113 | } | 115 | } |
114 | static int null_get_property( vo_driver_t* self, | 116 | static int null_get_property( vo_driver_t* self, |
115 | int property ){ | 117 | int property ){ |
116 | printf("property get]n"); | 118 | printf("property get]n"); |
117 | return 0; | 119 | return 0; |
118 | } | 120 | } |
119 | static int null_set_property( vo_driver_t* self, | 121 | static int null_set_property( vo_driver_t* self, |
120 | int property, | 122 | int property, |
121 | int value ){ | 123 | int value ){ |
122 | printf("set property\n"); | 124 | printf("set property\n"); |
123 | return value; | 125 | return value; |
124 | } | 126 | } |
125 | static void null_get_property_min_max( vo_driver_t* self, | 127 | static void null_get_property_min_max( vo_driver_t* self, |
126 | int property, int *min, | 128 | int property, int *min, |
127 | int *max ){ | 129 | int *max ){ |
128 | printf("min max\n"); | 130 | printf("min max\n"); |
129 | *max = 0; | 131 | *max = 0; |
130 | *min = 0; | 132 | *min = 0; |
131 | } | 133 | } |
132 | static int null_gui_data_exchange( vo_driver_t* self, | 134 | static int null_gui_data_exchange( vo_driver_t* self, |
133 | int data_type, | 135 | int data_type, |
134 | void *data ){ | 136 | void *data ){ |
135 | return 0; | 137 | return 0; |
136 | } | 138 | } |
137 | static void null_exit( vo_driver_t* self ){ | 139 | static void null_exit( vo_driver_t* self ){ |
138 | null_driver_t* this = (null_driver_t*)self; | 140 | null_driver_t* this = (null_driver_t*)self; |
139 | free ( this ); | 141 | free ( this ); |
140 | } | 142 | } |
141 | static int null_redraw_needed( vo_driver_t* self ){ | 143 | static int null_redraw_needed( vo_driver_t* self ){ |
142 | return 0; | 144 | return 0; |
143 | } | 145 | } |
144 | 146 | ||
145 | 147 | ||
146 | vo_driver_t* init_video_out_plugin( config_values_t* conf, | 148 | vo_driver_t* init_video_out_plugin( config_values_t* conf, |
147 | void* video ){ | 149 | void* video ){ |
148 | null_driver_t *vo; | 150 | null_driver_t *vo; |
149 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); | 151 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); |
152 | vo->m_show_video = 0; // false | ||
153 | vo->m_video_fullscreen = 0; | ||
154 | vo->m_is_scaling = 0; | ||
150 | /* memset? */ | 155 | /* memset? */ |
151 | 156 | ||
152 | /* install callback handlers*/ | 157 | /* install callback handlers*/ |
153 | vo->vo_driver.get_capabilities = null_get_capabilities; | 158 | vo->vo_driver.get_capabilities = null_get_capabilities; |
154 | vo->vo_driver.alloc_frame = null_alloc_frame; | 159 | vo->vo_driver.alloc_frame = null_alloc_frame; |
155 | vo->vo_driver.update_frame_format = null_update_frame_format; | 160 | vo->vo_driver.update_frame_format = null_update_frame_format; |
156 | vo->vo_driver.display_frame = null_display_frame; | 161 | vo->vo_driver.display_frame = null_display_frame; |
157 | vo->vo_driver.overlay_blend = null_overlay_blend; | 162 | vo->vo_driver.overlay_blend = null_overlay_blend; |
158 | vo->vo_driver.get_property = null_get_property; | 163 | vo->vo_driver.get_property = null_get_property; |
159 | vo->vo_driver.set_property = null_set_property; | 164 | vo->vo_driver.set_property = null_set_property; |
160 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 165 | vo->vo_driver.get_property_min_max = null_get_property_min_max; |
161 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; | 166 | vo->vo_driver.gui_data_exchange = null_gui_data_exchange; |
162 | vo->vo_driver.exit = null_exit; | 167 | vo->vo_driver.exit = null_exit; |
163 | vo->vo_driver.redraw_needed = null_redraw_needed; | 168 | vo->vo_driver.redraw_needed = null_redraw_needed; |
164 | 169 | ||
165 | 170 | ||
166 | /* capabilities */ | 171 | /* capabilities */ |
167 | vo->m_capabilities = /*VO_CAP_COPIES_IMAGE |*/ VO_CAP_YV12 | VO_CAP_BRIGHTNESS; | 172 | vo->m_capabilities = /*VO_CAP_COPIES_IMAGE |*/ VO_CAP_YV12 | VO_CAP_BRIGHTNESS; |
168 | printf("done initialisation\n"); | 173 | printf("done initialisation\n"); |
169 | return (vo_driver_t*) vo; | 174 | return (vo_driver_t*) vo; |
170 | } | 175 | } |
171 | 176 | ||
172 | static vo_info_t vo_info_null = { | 177 | static vo_info_t vo_info_null = { |
173 | 5, | 178 | 5, |
174 | "null plugin", | 179 | "null plugin", |
175 | NULL, | 180 | NULL, |
176 | VISUAL_TYPE_FB, | 181 | VISUAL_TYPE_FB, |
177 | 5 | 182 | 5 |
178 | }; | 183 | }; |
179 | 184 | ||
180 | vo_info_t *get_video_out_plugin_info(){ | 185 | vo_info_t *get_video_out_plugin_info(){ |
181 | vo_info_null.description = _("xine video output plugin using null device"); | 186 | vo_info_null.description = _("xine video output plugin using null device"); |
182 | return &vo_info_null; | 187 | return &vo_info_null; |
183 | } | 188 | } |
189 | |||
190 | /* this is special for this device */ | ||
191 | /** | ||
192 | * We know that we will be controled by the XINE LIB++ | ||
193 | */ | ||
194 | |||
195 | /** | ||
196 | * | ||
197 | */ | ||
198 | int null_is_showing_video( vo_driver_t* self ){ | ||
199 | null_driver_t* this = (null_driver_t*)self; | ||
200 | return this->m_show_video; | ||
201 | } | ||
202 | void null_set_show_video( vo_driver_t* self, int show ) { | ||
203 | ((null_driver_t*)self)->m_show_video = show; | ||
204 | } | ||
205 | |||
206 | int null_is_fullscreen( vo_driver_t* self ){ | ||
207 | return ((null_driver_t*)self)->m_video_fullscreen; | ||
208 | } | ||
209 | void null_set_fullscreen( vo_driver_t* self, int screen ){ | ||
210 | ((null_driver_t*)self)->m_video_fullscreen = screen; | ||
211 | } | ||
212 | int null_is_scaling( vo_driver_t* self ){ | ||
213 | return ((null_driver_t*)self)->m_is_scaling; | ||
214 | } | ||
215 | void null_set_scaling( vo_driver_t* self, int scale ){ | ||
216 | ((null_driver_t*)self)->m_is_scaling = scale; | ||
217 | } | ||
218 | |||