gstreamer 0.10 port. There's a problem with the seek, no evas sink yet

SVN revision: 20273
This commit is contained in:
doursse 2006-02-04 13:43:13 +00:00 committed by doursse
parent 5d04321374
commit 7ecab55f5b
7 changed files with 510 additions and 642 deletions

View File

@ -157,9 +157,9 @@ HAVE_GSTPLUG="no"
if test "$enable_gstreamer" != "no" ; then
dnl Gstreamer version requirement
GST_REQS=0.8.10
GSTPLUG_REQS=0.8.10
GST_MAJORMINOR=0.8
GST_REQS=0.10.2
GSTPLUG_REQS=0.10.1
GST_MAJORMINOR=0.10
PKG_CHECK_MODULES(GST, \
gstreamer-$GST_MAJORMINOR >= $GST_REQS,
@ -167,14 +167,19 @@ if test "$enable_gstreamer" != "no" ; then
AC_MSG_RESULT($HAVE_GSTREAMER)
PKG_CHECK_MODULES(GSTPLUG, \
gstreamer-plugins-$GST_MAJORMINOR >= $GSTPLUG_REQS,
gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPLUG_REQS,
HAVE_GSTPLUG="yes", HAVE_GSTPLUG="no")
AC_MSG_RESULT($HAVE_GSTPLUG)
AM_GST_ELEMENT_CHECK(
[ffmpeg],
[HAVE_GSTFFMPEG="yes"],
[HAVE_GSTFFMPEG="no"])
fi
if test "$enable_gstreamer$HAVE_GSTREAMER" = "yesno" ; then
AC_MSG_ERROR(gstreamer not found)
fi
if test "$HAVE_GSTPLUG" = "no" ; then
if test "$HAVE_GSTPLUG" = "no" -o test "$HAVE_GSTFFMPEG" = "no"; then
if test "$HAVE_GSTREAMER" = "no" ; then
GSTPLUG_MSG="no"
else
@ -230,6 +235,7 @@ echo " Modules:"
echo " Xine...............: $HAVE_XINE"
echo " Gstreamer..........: $HAVE_GSTREAMER"
echo " Gstreamer plugins..: $GSTPLUG_MSG"
echo " Gstreamer FFmpeg...: $HAVE_GSTFFMPEG"
echo
echo " Compilation..........: make"
echo

View File

@ -24,9 +24,11 @@ typedef struct _Emotion_Video_Module Emotion_Video_Module;
enum _Emotion_Format
{
EMOTION_YV12,
EMOTION_YUY2, /* unused for now since evas does not support yuy2 format */
EMOTION_BGRA
EMOTION_FORMAT_NONE,
EMOTION_FORMAT_I420,
EMOTION_FORMAT_YV12,
EMOTION_FORMAT_YUY2, /* unused for now since evas does not support yuy2 format */
EMOTION_FORMAT_BGRA
};
struct _Emotion_Video_Module
@ -40,6 +42,8 @@ struct _Emotion_Video_Module
void (*size_get) (void *ef, int *w, int *h);
void (*pos_set) (void *ef, double pos);
double (*len_get) (void *ef);
int (*fps_num_get) (void *ef);
int (*fps_den_get) (void *ef);
double (*fps_get) (void *ef);
double (*pos_get) (void *ef);
double (*ratio_get) (void *ef);

View File

@ -1003,7 +1003,7 @@ _pixels_get(void *data, Evas_Object *obj)
ih = h;
}
format = sd->module->format_get(sd->video);
if (format == EMOTION_YV12)
if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420))
{
unsigned char **rows;
Evas_Pixel_Import_Source ps;
@ -1029,7 +1029,7 @@ _pixels_get(void *data, Evas_Object *obj)
evas_object_image_pixels_dirty_set(obj, 0);
free(ps.rows);
}
else if (format == EMOTION_BGRA)
else if (format == EMOTION_FORMAT_BGRA)
{
unsigned char *bgra_data;
if (sd->module->bgra_data_get(sd->video, &bgra_data));

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +1,33 @@
#ifndef __EMOTION_GSTREAMER_H__
#define __EMOTION_GSTREAMER_H__
#include <Ecore_Data.h>
#include <gst/gst.h>
typedef struct _Emotion_Video_Sink Emotion_Video_Sink;
struct _Emotion_Video_Sink
{
GstElement *sink;
unsigned long long length_time;
unsigned long long length_frames;
unsigned int width;
unsigned int height;
unsigned int par_num;
unsigned int par_den;
double framerate;
GstElement *sink;
gdouble length_time;
gint width;
gint height;
gint fps_num;
gint fps_den;
guint32 fourcc;
};
typedef struct _Emotion_Audio_Sink Emotion_Audio_Sink;
struct _Emotion_Audio_Sink
{
GstElement *sink;
unsigned long long length_time;
unsigned long long length_samples;
unsigned int channels;
unsigned int samplerate;
GstElement *sink;
gdouble length_time;
gint channels;
gint samplerate;
};
typedef struct _Emotion_Gstreamer_Video Emotion_Gstreamer_Video;
@ -35,42 +35,43 @@ typedef struct _Emotion_Gstreamer_Video Emotion_Gstreamer_Video;
struct _Emotion_Gstreamer_Video
{
/* Gstreamer elements */
GstElement *pipeline;
GstElement *pipeline;
/* Sinks */
Ecore_List *video_sinks;
Ecore_List *audio_sinks;
Ecore_List *video_sinks;
Ecore_List *audio_sinks;
int video_sink_nbr;
int audio_sink_nbr;
/* Evas object */
Evas_Object *obj;
unsigned char *obj_data;
Evas_Object *obj;
unsigned char *obj_data;
/* Characteristics */
int position;
int width;
int height;
double ratio;
/* Characteristics of stream */
int position;
double ratio;
volatile int seek_to;
volatile int get_poslen;
volatile double seek_to_pos;
volatile int seek_to;
volatile int get_poslen;
volatile double seek_to_pos;
int fd_ev_read;
int fd_ev_write;
Ecore_Fd_Handler *fd_ev_handler;
int fd_ev_read;
int fd_ev_write;
Ecore_Fd_Handler *fd_ev_handler;
unsigned char play : 1;
unsigned char video_mute : 1;
unsigned char audio_mute : 1;
unsigned char play : 1;
unsigned char video_mute : 1;
unsigned char audio_mute : 1;
};
unsigned char module_open (Evas_Object *obj,
Emotion_Video_Module **module,
void **video);
unsigned char module_open (Evas_Object *obj,
Emotion_Video_Module **module,
void **video);
void module_close (Emotion_Video_Module *module,
void *video);
void module_close (Emotion_Video_Module *module,
void *video);
#endif /* __EMOTION_GSTREAMER_H__ */

View File

@ -11,6 +11,8 @@ static void em_stop(void *ef);
static void em_size_get(void *ef, int *w, int *h);
static void em_pos_set(void *ef, double pos);
static double em_len_get(void *ef);
static int em_fps_num_get(void *ef);
static int em_fps_den_get(void *ef);
static double em_fps_get(void *ef);
static double em_pos_get(void *ef);
static double em_ratio_get(void *ef);
@ -483,6 +485,24 @@ em_len_get(void *ef)
return ev->len;
}
static int
em_fps_num_get(void *ef)
{
Emotion_Xine_Video *ev;
ev = (Emotion_Xine_Video *)ef;
return (int)(ev->fps * 10000.0);
}
static int
em_fps_den_get(void *ef)
{
Emotion_Xine_Video *ev;
ev = (Emotion_Xine_Video *)ef;
return 10000;
}
static double
em_fps_get(void *ef)
{
@ -563,7 +583,7 @@ static Emotion_Format em_format_get(void *ef)
if (fr)
return fr->format;
return EMOTION_YV12;
return EMOTION_FORMAT_YV12;
}
static void
@ -1370,6 +1390,8 @@ static Emotion_Video_Module em_module =
em_size_get, /* size_get */
em_pos_set, /* pos_set */
em_len_get, /* len_get */
em_fps_num_get, /* fps_num_get */
em_fps_den_get, /* fps_den_get */
em_fps_get, /* fps_get */
em_pos_get, /* pos_get */
em_ratio_get, /* ratio_get */

View File

@ -361,7 +361,7 @@ _emotion_frame_format_update(vo_driver_t *vo_driver, vo_frame_t *vo_frame, uint3
{
int y_size, uv_size;
fr->frame.format = EMOTION_YV12;
fr->frame.format = EMOTION_FORMAT_YV12;
fr->vo_frame.pitches[0] = 8 * ((width + 7) / 8);
fr->vo_frame.pitches[1] = 8 * ((width + 15) / 16);
fr->vo_frame.pitches[2] = 8 * ((width + 15) / 16);
@ -387,7 +387,7 @@ _emotion_frame_format_update(vo_driver_t *vo_driver, vo_frame_t *vo_frame, uint3
break;
case XINE_IMGFMT_YUY2:
{
fr->frame.format = EMOTION_BGRA;
fr->frame.format = EMOTION_FORMAT_BGRA;
fr->vo_frame.pitches[0] = 8 * ((width + 3) / 4);
fr->vo_frame.pitches[1] = 0;
fr->vo_frame.pitches[2] = 0;