forked from enlightenment/efl
gstreamer 0.10 port. There's a problem with the seek, no evas sink yet
SVN revision: 20273
This commit is contained in:
parent
5d04321374
commit
7ecab55f5b
|
@ -157,9 +157,9 @@ HAVE_GSTPLUG="no"
|
||||||
if test "$enable_gstreamer" != "no" ; then
|
if test "$enable_gstreamer" != "no" ; then
|
||||||
|
|
||||||
dnl Gstreamer version requirement
|
dnl Gstreamer version requirement
|
||||||
GST_REQS=0.8.10
|
GST_REQS=0.10.2
|
||||||
GSTPLUG_REQS=0.8.10
|
GSTPLUG_REQS=0.10.1
|
||||||
GST_MAJORMINOR=0.8
|
GST_MAJORMINOR=0.10
|
||||||
|
|
||||||
PKG_CHECK_MODULES(GST, \
|
PKG_CHECK_MODULES(GST, \
|
||||||
gstreamer-$GST_MAJORMINOR >= $GST_REQS,
|
gstreamer-$GST_MAJORMINOR >= $GST_REQS,
|
||||||
|
@ -167,14 +167,19 @@ if test "$enable_gstreamer" != "no" ; then
|
||||||
AC_MSG_RESULT($HAVE_GSTREAMER)
|
AC_MSG_RESULT($HAVE_GSTREAMER)
|
||||||
|
|
||||||
PKG_CHECK_MODULES(GSTPLUG, \
|
PKG_CHECK_MODULES(GSTPLUG, \
|
||||||
gstreamer-plugins-$GST_MAJORMINOR >= $GSTPLUG_REQS,
|
gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPLUG_REQS,
|
||||||
HAVE_GSTPLUG="yes", HAVE_GSTPLUG="no")
|
HAVE_GSTPLUG="yes", HAVE_GSTPLUG="no")
|
||||||
AC_MSG_RESULT($HAVE_GSTPLUG)
|
AC_MSG_RESULT($HAVE_GSTPLUG)
|
||||||
|
|
||||||
|
AM_GST_ELEMENT_CHECK(
|
||||||
|
[ffmpeg],
|
||||||
|
[HAVE_GSTFFMPEG="yes"],
|
||||||
|
[HAVE_GSTFFMPEG="no"])
|
||||||
fi
|
fi
|
||||||
if test "$enable_gstreamer$HAVE_GSTREAMER" = "yesno" ; then
|
if test "$enable_gstreamer$HAVE_GSTREAMER" = "yesno" ; then
|
||||||
AC_MSG_ERROR(gstreamer not found)
|
AC_MSG_ERROR(gstreamer not found)
|
||||||
fi
|
fi
|
||||||
if test "$HAVE_GSTPLUG" = "no" ; then
|
if test "$HAVE_GSTPLUG" = "no" -o test "$HAVE_GSTFFMPEG" = "no"; then
|
||||||
if test "$HAVE_GSTREAMER" = "no" ; then
|
if test "$HAVE_GSTREAMER" = "no" ; then
|
||||||
GSTPLUG_MSG="no"
|
GSTPLUG_MSG="no"
|
||||||
else
|
else
|
||||||
|
@ -230,6 +235,7 @@ echo " Modules:"
|
||||||
echo " Xine...............: $HAVE_XINE"
|
echo " Xine...............: $HAVE_XINE"
|
||||||
echo " Gstreamer..........: $HAVE_GSTREAMER"
|
echo " Gstreamer..........: $HAVE_GSTREAMER"
|
||||||
echo " Gstreamer plugins..: $GSTPLUG_MSG"
|
echo " Gstreamer plugins..: $GSTPLUG_MSG"
|
||||||
|
echo " Gstreamer FFmpeg...: $HAVE_GSTFFMPEG"
|
||||||
echo
|
echo
|
||||||
echo " Compilation..........: make"
|
echo " Compilation..........: make"
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -24,9 +24,11 @@ typedef struct _Emotion_Video_Module Emotion_Video_Module;
|
||||||
|
|
||||||
enum _Emotion_Format
|
enum _Emotion_Format
|
||||||
{
|
{
|
||||||
EMOTION_YV12,
|
EMOTION_FORMAT_NONE,
|
||||||
EMOTION_YUY2, /* unused for now since evas does not support yuy2 format */
|
EMOTION_FORMAT_I420,
|
||||||
EMOTION_BGRA
|
EMOTION_FORMAT_YV12,
|
||||||
|
EMOTION_FORMAT_YUY2, /* unused for now since evas does not support yuy2 format */
|
||||||
|
EMOTION_FORMAT_BGRA
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Emotion_Video_Module
|
struct _Emotion_Video_Module
|
||||||
|
@ -40,6 +42,8 @@ struct _Emotion_Video_Module
|
||||||
void (*size_get) (void *ef, int *w, int *h);
|
void (*size_get) (void *ef, int *w, int *h);
|
||||||
void (*pos_set) (void *ef, double pos);
|
void (*pos_set) (void *ef, double pos);
|
||||||
double (*len_get) (void *ef);
|
double (*len_get) (void *ef);
|
||||||
|
int (*fps_num_get) (void *ef);
|
||||||
|
int (*fps_den_get) (void *ef);
|
||||||
double (*fps_get) (void *ef);
|
double (*fps_get) (void *ef);
|
||||||
double (*pos_get) (void *ef);
|
double (*pos_get) (void *ef);
|
||||||
double (*ratio_get) (void *ef);
|
double (*ratio_get) (void *ef);
|
||||||
|
|
|
@ -1003,7 +1003,7 @@ _pixels_get(void *data, Evas_Object *obj)
|
||||||
ih = h;
|
ih = h;
|
||||||
}
|
}
|
||||||
format = sd->module->format_get(sd->video);
|
format = sd->module->format_get(sd->video);
|
||||||
if (format == EMOTION_YV12)
|
if ((format == EMOTION_FORMAT_YV12) || (format == EMOTION_FORMAT_I420))
|
||||||
{
|
{
|
||||||
unsigned char **rows;
|
unsigned char **rows;
|
||||||
Evas_Pixel_Import_Source ps;
|
Evas_Pixel_Import_Source ps;
|
||||||
|
@ -1029,7 +1029,7 @@ _pixels_get(void *data, Evas_Object *obj)
|
||||||
evas_object_image_pixels_dirty_set(obj, 0);
|
evas_object_image_pixels_dirty_set(obj, 0);
|
||||||
free(ps.rows);
|
free(ps.rows);
|
||||||
}
|
}
|
||||||
else if (format == EMOTION_BGRA)
|
else if (format == EMOTION_FORMAT_BGRA)
|
||||||
{
|
{
|
||||||
unsigned char *bgra_data;
|
unsigned char *bgra_data;
|
||||||
if (sd->module->bgra_data_get(sd->video, &bgra_data));
|
if (sd->module->bgra_data_get(sd->video, &bgra_data));
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,33 +1,33 @@
|
||||||
#ifndef __EMOTION_GSTREAMER_H__
|
#ifndef __EMOTION_GSTREAMER_H__
|
||||||
#define __EMOTION_GSTREAMER_H__
|
#define __EMOTION_GSTREAMER_H__
|
||||||
|
|
||||||
|
|
||||||
#include <Ecore_Data.h>
|
#include <Ecore_Data.h>
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
|
||||||
typedef struct _Emotion_Video_Sink Emotion_Video_Sink;
|
typedef struct _Emotion_Video_Sink Emotion_Video_Sink;
|
||||||
|
|
||||||
struct _Emotion_Video_Sink
|
struct _Emotion_Video_Sink
|
||||||
{
|
{
|
||||||
GstElement *sink;
|
GstElement *sink;
|
||||||
unsigned long long length_time;
|
gdouble length_time;
|
||||||
unsigned long long length_frames;
|
gint width;
|
||||||
unsigned int width;
|
gint height;
|
||||||
unsigned int height;
|
gint fps_num;
|
||||||
unsigned int par_num;
|
gint fps_den;
|
||||||
unsigned int par_den;
|
guint32 fourcc;
|
||||||
double framerate;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _Emotion_Audio_Sink Emotion_Audio_Sink;
|
typedef struct _Emotion_Audio_Sink Emotion_Audio_Sink;
|
||||||
|
|
||||||
struct _Emotion_Audio_Sink
|
struct _Emotion_Audio_Sink
|
||||||
{
|
{
|
||||||
GstElement *sink;
|
GstElement *sink;
|
||||||
unsigned long long length_time;
|
gdouble length_time;
|
||||||
unsigned long long length_samples;
|
gint channels;
|
||||||
unsigned int channels;
|
gint samplerate;
|
||||||
unsigned int samplerate;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _Emotion_Gstreamer_Video Emotion_Gstreamer_Video;
|
typedef struct _Emotion_Gstreamer_Video Emotion_Gstreamer_Video;
|
||||||
|
@ -35,42 +35,43 @@ typedef struct _Emotion_Gstreamer_Video Emotion_Gstreamer_Video;
|
||||||
struct _Emotion_Gstreamer_Video
|
struct _Emotion_Gstreamer_Video
|
||||||
{
|
{
|
||||||
/* Gstreamer elements */
|
/* Gstreamer elements */
|
||||||
GstElement *pipeline;
|
GstElement *pipeline;
|
||||||
|
|
||||||
/* Sinks */
|
/* Sinks */
|
||||||
Ecore_List *video_sinks;
|
Ecore_List *video_sinks;
|
||||||
Ecore_List *audio_sinks;
|
Ecore_List *audio_sinks;
|
||||||
|
|
||||||
|
int video_sink_nbr;
|
||||||
|
int audio_sink_nbr;
|
||||||
|
|
||||||
/* Evas object */
|
/* Evas object */
|
||||||
Evas_Object *obj;
|
Evas_Object *obj;
|
||||||
unsigned char *obj_data;
|
unsigned char *obj_data;
|
||||||
|
|
||||||
/* Characteristics */
|
/* Characteristics of stream */
|
||||||
int position;
|
int position;
|
||||||
int width;
|
double ratio;
|
||||||
int height;
|
|
||||||
double ratio;
|
|
||||||
|
|
||||||
volatile int seek_to;
|
volatile int seek_to;
|
||||||
volatile int get_poslen;
|
volatile int get_poslen;
|
||||||
volatile double seek_to_pos;
|
volatile double seek_to_pos;
|
||||||
|
|
||||||
int fd_ev_read;
|
int fd_ev_read;
|
||||||
int fd_ev_write;
|
int fd_ev_write;
|
||||||
Ecore_Fd_Handler *fd_ev_handler;
|
Ecore_Fd_Handler *fd_ev_handler;
|
||||||
|
|
||||||
|
|
||||||
unsigned char play : 1;
|
unsigned char play : 1;
|
||||||
unsigned char video_mute : 1;
|
unsigned char video_mute : 1;
|
||||||
unsigned char audio_mute : 1;
|
unsigned char audio_mute : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned char module_open (Evas_Object *obj,
|
unsigned char module_open (Evas_Object *obj,
|
||||||
Emotion_Video_Module **module,
|
Emotion_Video_Module **module,
|
||||||
void **video);
|
void **video);
|
||||||
|
|
||||||
void module_close (Emotion_Video_Module *module,
|
void module_close (Emotion_Video_Module *module,
|
||||||
void *video);
|
void *video);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __EMOTION_GSTREAMER_H__ */
|
#endif /* __EMOTION_GSTREAMER_H__ */
|
||||||
|
|
|
@ -11,6 +11,8 @@ static void em_stop(void *ef);
|
||||||
static void em_size_get(void *ef, int *w, int *h);
|
static void em_size_get(void *ef, int *w, int *h);
|
||||||
static void em_pos_set(void *ef, double pos);
|
static void em_pos_set(void *ef, double pos);
|
||||||
static double em_len_get(void *ef);
|
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_fps_get(void *ef);
|
||||||
static double em_pos_get(void *ef);
|
static double em_pos_get(void *ef);
|
||||||
static double em_ratio_get(void *ef);
|
static double em_ratio_get(void *ef);
|
||||||
|
@ -483,6 +485,24 @@ em_len_get(void *ef)
|
||||||
return ev->len;
|
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
|
static double
|
||||||
em_fps_get(void *ef)
|
em_fps_get(void *ef)
|
||||||
{
|
{
|
||||||
|
@ -563,7 +583,7 @@ static Emotion_Format em_format_get(void *ef)
|
||||||
|
|
||||||
if (fr)
|
if (fr)
|
||||||
return fr->format;
|
return fr->format;
|
||||||
return EMOTION_YV12;
|
return EMOTION_FORMAT_YV12;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1370,6 +1390,8 @@ static Emotion_Video_Module em_module =
|
||||||
em_size_get, /* size_get */
|
em_size_get, /* size_get */
|
||||||
em_pos_set, /* pos_set */
|
em_pos_set, /* pos_set */
|
||||||
em_len_get, /* len_get */
|
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_fps_get, /* fps_get */
|
||||||
em_pos_get, /* pos_get */
|
em_pos_get, /* pos_get */
|
||||||
em_ratio_get, /* ratio_get */
|
em_ratio_get, /* ratio_get */
|
||||||
|
|
|
@ -361,7 +361,7 @@ _emotion_frame_format_update(vo_driver_t *vo_driver, vo_frame_t *vo_frame, uint3
|
||||||
{
|
{
|
||||||
int y_size, uv_size;
|
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[0] = 8 * ((width + 7) / 8);
|
||||||
fr->vo_frame.pitches[1] = 8 * ((width + 15) / 16);
|
fr->vo_frame.pitches[1] = 8 * ((width + 15) / 16);
|
||||||
fr->vo_frame.pitches[2] = 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;
|
break;
|
||||||
case XINE_IMGFMT_YUY2:
|
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[0] = 8 * ((width + 3) / 4);
|
||||||
fr->vo_frame.pitches[1] = 0;
|
fr->vo_frame.pitches[1] = 0;
|
||||||
fr->vo_frame.pitches[2] = 0;
|
fr->vo_frame.pitches[2] = 0;
|
||||||
|
|
Loading…
Reference in New Issue