summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/nullvideo.c8
-rw-r--r--noncore/multimedia/opieplayer2/opieplayer2.pro10
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.h4
3 files changed, 12 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c
index 5224862..877e49a 100644
--- a/noncore/multimedia/opieplayer2/nullvideo.c
+++ b/noncore/multimedia/opieplayer2/nullvideo.c
@@ -1,183 +1,183 @@
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 <video_out.h>
7#include <xine/xine_internal.h> 7#include <xine_internal.h>
8#include <xine/xineutils.h> 8#include <xineutils.h>
9#include <xine/configfile.h> 9#include <configfile.h>
10 10
11typedef struct null_driver_s null_driver_t; 11typedef struct null_driver_s null_driver_t;
12 12
13struct null_driver_s { 13struct 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};
18typedef struct opie_frame_s opie_frame_t; 18typedef struct opie_frame_s opie_frame_t;
19struct opie_frame_s { 19struct 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; 23 int m_width;
24 int m_height; 24 int m_height;
25 uint8_t *chunk[3]; 25 uint8_t *chunk[3];
26 null_driver_t *output; 26 null_driver_t *output;
27}; 27};
28 28
29static uint32_t null_get_capabilities(vo_driver_t *self ){ 29static uint32_t null_get_capabilities(vo_driver_t *self ){
30 null_driver_t* this = (null_driver_t*)self; 30 null_driver_t* this = (null_driver_t*)self;
31 printf("capabilities\n"); 31 printf("capabilities\n");
32 return this->m_capabilities; 32 return this->m_capabilities;
33} 33}
34 34
35/* take care of the frame*/ 35/* take care of the frame*/
36static void null_frame_dispose( vo_frame_t* vo_img){ 36static void null_frame_dispose( vo_frame_t* vo_img){
37 opie_frame_t* frame = (opie_frame_t*)vo_img; 37 opie_frame_t* frame = (opie_frame_t*)vo_img;
38 printf("frame_dispose\n"); 38 printf("frame_dispose\n");
39 free (frame); 39 free (frame);
40} 40}
41static void null_frame_field( vo_frame_t* frame, int inti ){ 41static void null_frame_field( vo_frame_t* frame, int inti ){
42 printf("frame_field\n"); 42 printf("frame_field\n");
43 /* not needed */ 43 /* not needed */
44} 44}
45 45
46/* end take care of frames*/ 46/* end take care of frames*/
47 47
48static vo_frame_t* null_alloc_frame( vo_driver_t* self ){ 48static vo_frame_t* null_alloc_frame( vo_driver_t* self ){
49 null_driver_t* this = (null_driver_t*)self; 49 null_driver_t* this = (null_driver_t*)self;
50 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) );
51 memset( frame, 0, sizeof( opie_frame_t) ); 51 memset( frame, 0, sizeof( opie_frame_t) );
52 printf("alloc_frame\n"); 52 printf("alloc_frame\n");
53 frame->name = "opie\0"; 53 frame->name = "opie\0";
54 frame->version = 1; 54 frame->version = 1;
55 frame->output = this; 55 frame->output = this;
56 56
57 /* initialize the frame*/ 57 /* initialize the frame*/
58 frame->frame.driver = self; 58 frame->frame.driver = self;
59 /*frame.frame.free = null_frame_free;*/ 59 /*frame.frame.free = null_frame_free;*/
60 frame->frame.copy = NULL; 60 frame->frame.copy = NULL;
61 frame->frame.field = null_frame_field; 61 frame->frame.field = null_frame_field;
62 frame->frame.dispose = null_frame_dispose; 62 frame->frame.dispose = null_frame_dispose;
63 63
64 64
65 return (vo_frame_t*) frame; 65 return (vo_frame_t*) frame;
66} 66}
67static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img, 67static void null_update_frame_format( vo_driver_t* self, vo_frame_t* img,
68 uint32_t width, uint32_t height, 68 uint32_t width, uint32_t height,
69 int ratio_code, int format, int flags ){ 69 int ratio_code, int format, int flags ){
70 null_driver_t* this = (null_driver_t*) self; 70 null_driver_t* this = (null_driver_t*) self;
71 opie_frame_t* frame = (opie_frame_t*)img; 71 opie_frame_t* frame = (opie_frame_t*)img;
72 /* not needed now */ 72 /* not needed now */
73 printf("update_frame_format\n"); 73 printf("update_frame_format\n");
74 printf("al crash aye?\n"); 74 printf("al crash aye?\n");
75 75
76 if(frame->chunk[0] ){ 76 if(frame->chunk[0] ){
77 free( frame->chunk[0] ); 77 free( frame->chunk[0] );
78 frame->chunk[0] = NULL; 78 frame->chunk[0] = NULL;
79 } 79 }
80 if(frame->chunk[1] ){ 80 if(frame->chunk[1] ){
81 free ( frame->chunk[1] ); 81 free ( frame->chunk[1] );
82 frame->chunk[1] = NULL; 82 frame->chunk[1] = NULL;
83 } 83 }
84 if(frame->chunk[2] ){ 84 if(frame->chunk[2] ){
85 free ( frame->chunk[2] ); 85 free ( frame->chunk[2] );
86 frame->chunk[2] = NULL; 86 frame->chunk[2] = NULL;
87 } 87 }
88 88
89 89
90 if( format == IMGFMT_YV12 ) { 90 if( format == IMGFMT_YV12 ) {
91 int image_size = width * height; /* cast ouch*/ 91 int image_size = width * height; /* cast ouch*/
92 frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, 92 frame->frame.base[0] = xine_xmalloc_aligned(16, image_size,
93 (void **)&frame->chunk[0] ); 93 (void **)&frame->chunk[0] );
94 frame->frame.base[1] = xine_xmalloc_aligned(16, image_size, 94 frame->frame.base[1] = xine_xmalloc_aligned(16, image_size,
95 (void **)&frame->chunk[1] ); 95 (void **)&frame->chunk[1] );
96 frame->frame.base[2] = xine_xmalloc_aligned(16, image_size, 96 frame->frame.base[2] = xine_xmalloc_aligned(16, image_size,
97 (void **)&frame->chunk[2] ); 97 (void **)&frame->chunk[2] );
98 }else{ 98 }else{
99 int image_size = width * height; /* cast ouch*/ 99 int image_size = width * height; /* cast ouch*/
100 frame->frame.base[0] = xine_xmalloc_aligned(16, image_size, 100 frame->frame.base[0] = xine_xmalloc_aligned(16, image_size,
101 (void **)&frame->chunk[0] ); 101 (void **)&frame->chunk[0] );
102 frame->chunk[1] = NULL; 102 frame->chunk[1] = NULL;
103 frame->chunk[2] = NULL; 103 frame->chunk[2] = NULL;
104 } 104 }
105 105
106} 106}
107static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){ 107static void null_display_frame( vo_driver_t* self, vo_frame_t *frame ){
108 printf("display frame\n"); 108 printf("display frame\n");
109} 109}
110static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame, 110static void null_overlay_blend( vo_driver_t* self, vo_frame_t* frame,
111 vo_overlay_t* overlay ){ 111 vo_overlay_t* overlay ){
112 /* sure */ 112 /* sure */
113} 113}
114static int null_get_property( vo_driver_t* self, 114static int null_get_property( vo_driver_t* self,
115 int property ){ 115 int property ){
116 printf("property get]n"); 116 printf("property get]n");
117 return 0; 117 return 0;
118} 118}
119static int null_set_property( vo_driver_t* self, 119static int null_set_property( vo_driver_t* self,
120 int property, 120 int property,
121 int value ){ 121 int value ){
122 printf("set property\n"); 122 printf("set property\n");
123 return value; 123 return value;
124} 124}
125static void null_get_property_min_max( vo_driver_t* self, 125static void null_get_property_min_max( vo_driver_t* self,
126 int property, int *min, 126 int property, int *min,
127 int *max ){ 127 int *max ){
128 printf("min max\n"); 128 printf("min max\n");
129 *max = 0; 129 *max = 0;
130 *min = 0; 130 *min = 0;
131} 131}
132static int null_gui_data_exchange( vo_driver_t* self, 132static int null_gui_data_exchange( vo_driver_t* self,
133 int data_type, 133 int data_type,
134 void *data ){ 134 void *data ){
135 return 0; 135 return 0;
136} 136}
137static void null_exit( vo_driver_t* self ){ 137static void null_exit( vo_driver_t* self ){
138 null_driver_t* this = (null_driver_t*)self; 138 null_driver_t* this = (null_driver_t*)self;
139 free ( this ); 139 free ( this );
140} 140}
141static int null_redraw_needed( vo_driver_t* self ){ 141static int null_redraw_needed( vo_driver_t* self ){
142 return 0; 142 return 0;
143} 143}
144 144
145 145
146vo_driver_t* init_video_out_plugin( config_values_t* conf, 146vo_driver_t* init_video_out_plugin( config_values_t* conf,
147 void* video ){ 147 void* video ){
148 null_driver_t *vo; 148 null_driver_t *vo;
149 vo = (null_driver_t*)malloc( sizeof(null_driver_t ) ); 149 vo = (null_driver_t*)malloc( sizeof(null_driver_t ) );
150 /* memset? */ 150 /* memset? */
151 151
152 /* install callback handlers*/ 152 /* install callback handlers*/
153 vo->vo_driver.get_capabilities = null_get_capabilities; 153 vo->vo_driver.get_capabilities = null_get_capabilities;
154 vo->vo_driver.alloc_frame = null_alloc_frame; 154 vo->vo_driver.alloc_frame = null_alloc_frame;
155 vo->vo_driver.update_frame_format = null_update_frame_format; 155 vo->vo_driver.update_frame_format = null_update_frame_format;
156 vo->vo_driver.display_frame = null_display_frame; 156 vo->vo_driver.display_frame = null_display_frame;
157 vo->vo_driver.overlay_blend = null_overlay_blend; 157 vo->vo_driver.overlay_blend = null_overlay_blend;
158 vo->vo_driver.get_property = null_get_property; 158 vo->vo_driver.get_property = null_get_property;
159 vo->vo_driver.set_property = null_set_property; 159 vo->vo_driver.set_property = null_set_property;
160 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;
161 vo->vo_driver.gui_data_exchange = null_gui_data_exchange; 161 vo->vo_driver.gui_data_exchange = null_gui_data_exchange;
162 vo->vo_driver.exit = null_exit; 162 vo->vo_driver.exit = null_exit;
163 vo->vo_driver.redraw_needed = null_redraw_needed; 163 vo->vo_driver.redraw_needed = null_redraw_needed;
164 164
165 165
166 /* capabilities */ 166 /* capabilities */
167 vo->m_capabilities = /*VO_CAP_COPIES_IMAGE |*/ VO_CAP_YV12 | VO_CAP_BRIGHTNESS; 167 vo->m_capabilities = /*VO_CAP_COPIES_IMAGE |*/ VO_CAP_YV12 | VO_CAP_BRIGHTNESS;
168 printf("done initialisation\n"); 168 printf("done initialisation\n");
169 return (vo_driver_t*) vo; 169 return (vo_driver_t*) vo;
170} 170}
171 171
172static vo_info_t vo_info_null = { 172static vo_info_t vo_info_null = {
173 5, 173 5,
174 "null plugin", 174 "null plugin",
175 NULL, 175 NULL,
176 VISUAL_TYPE_FB, 176 VISUAL_TYPE_FB,
177 5 177 5
178}; 178};
179 179
180vo_info_t *get_video_out_plugin_info(){ 180vo_info_t *get_video_out_plugin_info(){
181 vo_info_null.description = _("xine video output plugin using null device"); 181 vo_info_null.description = _("xine video output plugin using null device");
182 return &vo_info_null; 182 return &vo_info_null;
183} 183}
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro
index a6c7c2b..bcd9b92 100644
--- a/noncore/multimedia/opieplayer2/opieplayer2.pro
+++ b/noncore/multimedia/opieplayer2/opieplayer2.pro
@@ -1,17 +1,19 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on release 2CONFIG = qt warn_on release
3#release 3#release
4DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
5HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h\ 5HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h\
6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h 6 videowidget.h audiowidget.h playlistwidget.h mediaplayer.h inputDialog.h \
7 frame.h lib.h
7SOURCES = main.cpp \ 8SOURCES = main.cpp \
8 playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp\ 9 playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp\
9 videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp 10 videowidget.cpp audiowidget.cpp playlistwidget.cpp mediaplayer.cpp inputDialog.cpp \
11 frame.cpp lib.cpp nullvideo.c
10TARGET = opieplayer 12TARGET = opieplayer
11INCLUDEPATH += $(OPIEDIR)/include /usr/include 13INCLUDEPATH += $(OPIEDIR)/include
12DEPENDPATH += $(OPIEDIR)/include /usr/include 14DEPENDPATH += $(OPIEDIR)/include
13LIBS += -lqpe -lpthread -lopie -lxine -lxineutils 15LIBS += -lqpe -lpthread -lopie -lxine -lxineutils
14 16
15INCLUDEPATH += $(OPIEDIR)/include 17INCLUDEPATH += $(OPIEDIR)/include
16DEPENDPATH += $(OPIEDIR)/include 18DEPENDPATH += $(OPIEDIR)/include
17 19
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.h b/noncore/multimedia/opieplayer2/xinecontrol.h
index cba83c0..58ad8ec 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.h
+++ b/noncore/multimedia/opieplayer2/xinecontrol.h
@@ -1,38 +1,38 @@
1 1
2#ifndef XINECONTROL_H 2#ifndef XINECONTROL_H
3#define XINECONTROL_H 3#define XINECONTROL_H
4 4
5#include "lib.h" 5#include "lib.h"
6#include <qobject.h> 6#include <qobject.h>
7 7
8class XineControl : public QObject { 8class XineControl : public QObject {
9 Q_OBJECT 9 Q_OBJECT
10public: 10public:
11 XineControl( QObject *parent, const char *name ); 11 XineControl( QObject *parent = 0, const char *name =0 );
12 ~XineControl(); 12 ~XineControl();
13 13
14private slots: 14public slots:
15 void play( const QString& fileName ); 15 void play( const QString& fileName );
16 void stop(); 16 void stop();
17 void pause( bool ); 17 void pause( bool );
18 18
19 int currentTime(); 19 int currentTime();
20 20
21 // get length of media file and set it 21 // get length of media file and set it
22 void length(); 22 void length();
23 23
24 int position(); 24 int position();
25 25
26private: 26private:
27 XINE::Lib *libXine; 27 XINE::Lib *libXine;
28 int m_length; 28 int m_length;
29 int m_currentTime; 29 int m_currentTime;
30 int m_position; 30 int m_position;
31 31
32signals: 32signals:
33 void positionChanged( int position ); 33 void positionChanged( int position );
34 34
35}; 35};
36 36
37 37
38#endif 38#endif