author | zecke <zecke> | 2002-07-06 23:38:54 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-07-06 23:38:54 (UTC) |
commit | 4f44b353d8211a51e2f0bfb609f2c2d79c44827f (patch) (unidiff) | |
tree | 2178fb8097d7bb09c8a7fdac206dd64318a6b489 | |
parent | 8703ff76831bf3f971087440b991608d59f429bf (diff) | |
download | opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.zip opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.tar.gz opie-4f44b353d8211a51e2f0bfb609f2c2d79c44827f.tar.bz2 |
Null video fixes
lib updates
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 54 |
2 files changed, 55 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 123ca91..0ea85dd 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -14,69 +14,71 @@ vo_driver_t* init_video_out_plugin( config_values_t* conf, void* video); | |||
14 | } | 14 | } |
15 | 15 | ||
16 | using namespace XINE; | 16 | using namespace XINE; |
17 | 17 | ||
18 | Lib::Lib() { | 18 | Lib::Lib() { |
19 | printf("Lib"); | 19 | printf("Lib"); |
20 | QCString str( getenv("HOME") ); | 20 | QCString str( getenv("HOME") ); |
21 | str += "/Settings/opiexine.cf"; | 21 | str += "/Settings/opiexine.cf"; |
22 | // get the configuration | 22 | // get the configuration |
23 | m_config = xine_config_file_init( str.data() ); | 23 | m_config = xine_config_file_init( str.data() ); |
24 | 24 | ||
25 | // allocate oss for sound | 25 | // allocate oss for sound |
26 | // and fb for framebuffer | 26 | // and fb for framebuffer |
27 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; | 27 | m_audioOutput= xine_load_audio_output_plugin( m_config, "oss") ; |
28 | if (m_audioOutput == NULL ) | 28 | if (m_audioOutput == NULL ) |
29 | printf("Failure\n"); | 29 | printf("Failure\n"); |
30 | else | 30 | else |
31 | printf("Success\n"); | 31 | printf("Success\n"); |
32 | 32 | ||
33 | 33 | ||
34 | // test code | 34 | // test code |
35 | m_videoOutput = xine_load_video_output_plugin(m_config, "fb", | 35 | m_videoOutput = xine_load_video_output_plugin(m_config, "fb", |
36 | VISUAL_TYPE_FB, | 36 | VISUAL_TYPE_FB, |
37 | 0 ); | 37 | 0 ); |
38 | 38 | ||
39 | char** files = xine_list_video_output_plugins(3); | 39 | char** files = xine_list_video_output_plugins(3); |
40 | char* out; | 40 | char* out; |
41 | int i = 0; | 41 | int i = 0; |
42 | while ( ( out = files[i] ) != 0 ) { | 42 | while ( ( out = files[i] ) != 0 ) { |
43 | printf("Audio %s\n", out ); | 43 | printf("Audio %s\n", out ); |
44 | i++; | 44 | i++; |
45 | } | 45 | } |
46 | m_xine = xine_init( m_videoOutput, | 46 | // m_xine = xine_init( m_videoOutput, |
47 | m_audioOutput, | 47 | // m_audioOutput, |
48 | m_config ); | 48 | // m_config ); |
49 | // test loading | 49 | // test loading |
50 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); | 50 | m_videoOutput = ::init_video_out_plugin( m_config, NULL ); |
51 | m_xine = xine_init( m_videoOutput, | ||
52 | m_audioOutput, m_config ); | ||
51 | } | 53 | } |
52 | 54 | ||
53 | Lib::~Lib() { | 55 | Lib::~Lib() { |
54 | delete m_config; | 56 | delete m_config; |
55 | xine_exit( m_xine ); | 57 | xine_exit( m_xine ); |
56 | delete m_videoOutput; | 58 | delete m_videoOutput; |
57 | //delete m_audioOutput; | 59 | //delete m_audioOutput; |
58 | 60 | ||
59 | } | 61 | } |
60 | 62 | ||
61 | QCString Lib::version() { | 63 | QCString Lib::version() { |
62 | QCString str( xine_get_str_version() ); | 64 | QCString str( xine_get_str_version() ); |
63 | return str; | 65 | return str; |
64 | }; | 66 | }; |
65 | 67 | ||
66 | int Lib::majorVersion() { | 68 | int Lib::majorVersion() { |
67 | return xine_get_major_version(); | 69 | return xine_get_major_version(); |
68 | } | 70 | } |
69 | int Lib::minorVersion() { | 71 | int Lib::minorVersion() { |
70 | return xine_get_minor_version(); | 72 | return xine_get_minor_version(); |
71 | }; | 73 | }; |
72 | 74 | ||
73 | int Lib::subVersion() { | 75 | int Lib::subVersion() { |
74 | return xine_get_sub_version(); | 76 | return xine_get_sub_version(); |
75 | } | 77 | } |
76 | int Lib::play( const QString& fileName, | 78 | int Lib::play( const QString& fileName, |
77 | int startPos, | 79 | int startPos, |
78 | int start_time ) { | 80 | int start_time ) { |
79 | QString str = fileName; | 81 | QString str = fileName; |
80 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), | 82 | return xine_play( m_xine, QFile::encodeName(str.utf8() ).data(), |
81 | startPos, start_time); | 83 | startPos, start_time); |
82 | } | 84 | } |
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index c97800c..5224862 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -1,114 +1,160 @@ | |||
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 | ||
17 | }; | 17 | }; |
18 | typedef struct opie_frame_s opie_frame_t; | 18 | typedef struct opie_frame_s opie_frame_t; |
19 | struct opie_frame_s { | 19 | struct opie_frame_s { |
20 | vo_frame_t frame; | 20 | vo_frame_t frame; |
21 | char* name; | 21 | char* name; |
22 | int version; | 22 | int version; |
23 | int m_width; | ||
24 | int m_height; | ||
25 | uint8_t *chunk[3]; | ||
23 | null_driver_t *output; | 26 | null_driver_t *output; |
24 | }; | 27 | }; |
25 | 28 | ||
26 | static uint32_t null_get_capabilities(vo_driver_t *self ){ | 29 | static uint32_t null_get_capabilities(vo_driver_t *self ){ |
27 | null_driver_t* this = (null_driver_t*)self; | 30 | null_driver_t* this = (null_driver_t*)self; |
31 | printf("capabilities\n"); | ||
28 | return this->m_capabilities; | 32 | return this->m_capabilities; |
29 | } | 33 | } |
30 | 34 | ||
31 | /* take care of the frame*/ | 35 | /* take care of the frame*/ |
32 | static void null_frame_dispose( vo_frame_t* vo_img){ | 36 | static void null_frame_dispose( vo_frame_t* vo_img){ |
33 | opie_frame_t* frame = (opie_frame_t*)vo_img; | 37 | opie_frame_t* frame = (opie_frame_t*)vo_img; |
38 | printf("frame_dispose\n"); | ||
34 | free (frame); | 39 | free (frame); |
35 | } | 40 | } |
36 | static void null_frame_field( vo_frame_t* frame, int inti ){ | 41 | static void null_frame_field( vo_frame_t* frame, int inti ){ |
42 | printf("frame_field\n"); | ||
37 | /* not needed */ | 43 | /* not needed */ |
38 | } | 44 | } |
39 | 45 | ||
40 | /* end take care of frames*/ | 46 | /* end take care of frames*/ |
41 | 47 | ||
42 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ | 48 | static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ |
43 | null_driver_t* this = (null_driver_t*)self; | 49 | null_driver_t* this = (null_driver_t*)self; |
44 | opie_frame_t* frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); | 50 | opie_frame_t* frame = (opie_frame_t*)malloc ( sizeof(opie_frame_t) ); |
45 | memset( frame, 0, sizeof( opie_frame_t) ); | 51 | memset( frame, 0, sizeof( opie_frame_t) ); |
52 | printf("alloc_frame\n"); | ||
46 | frame->name = "opie\0"; | 53 | frame->name = "opie\0"; |
47 | frame->version = 1; | 54 | frame->version = 1; |
48 | frame->output = this; | 55 | frame->output = this; |
49 | 56 | ||
50 | /* initialize the frame*/ | 57 | /* initialize the frame*/ |
51 | frame->frame.driver = self; | 58 | frame->frame.driver = self; |
52 | /*frame.frame.free = null_frame_free;*/ | 59 | /*frame.frame.free = null_frame_free;*/ |
53 | frame->frame.copy = NULL; | 60 | frame->frame.copy = NULL; |
54 | frame->frame.field = null_frame_field; | 61 | frame->frame.field = null_frame_field; |
55 | frame->frame.dispose = null_frame_dispose; | 62 | frame->frame.dispose = null_frame_dispose; |
56 | 63 | ||
64 | |||
57 | return (vo_frame_t*) frame; | 65 | return (vo_frame_t*) frame; |
58 | } | 66 | } |
59 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, | 67 | static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, |
60 | uint32_t width, uint32_t height, | 68 | uint32_t width, uint32_t height, |
61 | int ratio_code, int format, int flags ){ | 69 | int ratio_code, int format, int flags ){ |
70 | null_driver_t* this = (null_driver_t*) self; | ||
71 | opie_frame_t* frame = (opie_frame_t*)img; | ||
62 | /* not needed now */ | 72 | /* not needed now */ |
73 | printf("update_frame_format\n"); | ||
74 | printf("al crash aye?\n"); | ||
75 | |||
76 | if(frame->chunk[0] ){ | ||
77 | free( frame->chunk[0] ); | ||
78 | frame->chunk[0] = NULL; | ||
79 | } | ||
80 | if(frame->chunk[1] ){ | ||
81 | free ( frame->chunk[1] ); | ||
82 | frame->chunk[1] = NULL; | ||
83 | } | ||
84 | if(frame->chunk[2] ){ | ||
85 | free ( frame->chunk[2] ); | ||
86 | frame->chunk[2] = NULL; | ||
87 | } | ||
88 | |||
89 | |||
90 | if( format == IMGFMT_YV12 ) { | ||
91 | int image_size = width * height; /* cast ouch*/ | ||
92 | frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, | ||
93 | (void **)&frame->chunk[0] ); | ||
94 | frame->frame.base[1] = xine_xmalloc_aligned(16, image_size, | ||
95 | (void **)&frame->chunk[1] ); | ||
96 | frame->frame.base[2] = xine_xmalloc_aligned(16, image_size, | ||
97 | (void **)&frame->chunk[2] ); | ||
98 | }else{ | ||
99 | int image_size = width * height; /* cast ouch*/ | ||
100 | frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, | ||
101 | (void **)&frame->chunk[0] ); | ||
102 | frame->chunk[1] = NULL; | ||
103 | frame->chunk[2] = NULL; | ||
104 | } | ||
105 | |||
63 | } | 106 | } |
64 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ | 107 | static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ |
65 | printf("display frame"); | 108 | printf("display frame\n"); |
66 | } | 109 | } |
67 | static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, | 110 | static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, |
68 | vo_overlay_t* overlay ){ | 111 | vo_overlay_t* overlay ){ |
69 | /* sure */ | 112 | /* sure */ |
70 | } | 113 | } |
71 | static int null_get_property( vo_driver_t* self, | 114 | static int null_get_property( vo_driver_t* self, |
72 | int property ){ | 115 | int property ){ |
116 | printf("property get]n"); | ||
73 | return 0; | 117 | return 0; |
74 | } | 118 | } |
75 | static int null_set_property( vo_driver_t* self, | 119 | static int null_set_property( vo_driver_t* self, |
76 | int property, | 120 | int property, |
77 | int value ){ | 121 | int value ){ |
122 | printf("set property\n"); | ||
78 | return value; | 123 | return value; |
79 | } | 124 | } |
80 | static void null_get_property_min_max( vo_driver_t* self, | 125 | static void null_get_property_min_max( vo_driver_t* self, |
81 | int property, int *min, | 126 | int property, int *min, |
82 | int *max ){ | 127 | int *max ){ |
128 | printf("min max\n"); | ||
83 | *max = 0; | 129 | *max = 0; |
84 | *min = 0; | 130 | *min = 0; |
85 | } | 131 | } |
86 | static int null_gui_data_exchange( vo_driver_t* self, | 132 | static int null_gui_data_exchange( vo_driver_t* self, |
87 | int data_type, | 133 | int data_type, |
88 | void *data ){ | 134 | void *data ){ |
89 | return 0; | 135 | return 0; |
90 | } | 136 | } |
91 | static void null_exit( vo_driver_t* self ){ | 137 | static void null_exit( vo_driver_t* self ){ |
92 | null_driver_t* this = (null_driver_t*)self; | 138 | null_driver_t* this = (null_driver_t*)self; |
93 | free ( this ); | 139 | free ( this ); |
94 | } | 140 | } |
95 | static int null_redraw_needed( vo_driver_t* self ){ | 141 | static int null_redraw_needed( vo_driver_t* self ){ |
96 | return 0; | 142 | return 0; |
97 | } | 143 | } |
98 | 144 | ||
99 | 145 | ||
100 | vo_driver_t* init_video_out_plugin( config_values_t* conf, | 146 | vo_driver_t* init_video_out_plugin( config_values_t* conf, |
101 | void* video ){ | 147 | void* video ){ |
102 | null_driver_t *vo; | 148 | null_driver_t *vo; |
103 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); | 149 | vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); |
104 | /* memset? */ | 150 | /* memset? */ |
105 | 151 | ||
106 | /* install callback handlers*/ | 152 | /* install callback handlers*/ |
107 | vo->vo_driver.get_capabilities = null_get_capabilities; | 153 | vo->vo_driver.get_capabilities = null_get_capabilities; |
108 | vo->vo_driver.alloc_frame = null_alloc_frame; | 154 | vo->vo_driver.alloc_frame = null_alloc_frame; |
109 | vo->vo_driver.update_frame_format = null_update_frame_format; | 155 | vo->vo_driver.update_frame_format = null_update_frame_format; |
110 | vo->vo_driver.display_frame = null_display_frame; | 156 | vo->vo_driver.display_frame = null_display_frame; |
111 | vo->vo_driver.overlay_blend = null_overlay_blend; | 157 | vo->vo_driver.overlay_blend = null_overlay_blend; |
112 | vo->vo_driver.get_property = null_get_property; | 158 | vo->vo_driver.get_property = null_get_property; |
113 | vo->vo_driver.set_property = null_set_property; | 159 | vo->vo_driver.set_property = null_set_property; |
114 | vo->vo_driver.get_property_min_max = null_get_property_min_max; | 160 | vo->vo_driver.get_property_min_max = null_get_property_min_max; |