2012-04-30 11:48:38 +02:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
c_mediaplayer.c
|
|
|
|
|
|
|
|
gb.media component
|
|
|
|
|
|
|
|
(c) 2012 Benoît Minisini <gambas@users.sourceforge.net>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 1, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#define __C_MEDIAPLAYER_C
|
|
|
|
|
|
|
|
#include "c_mediaplayer.h"
|
|
|
|
|
2012-05-01 02:42:37 +02:00
|
|
|
// GStreamer playbin2 documents a enum that is not defined anywhere...
|
|
|
|
// I have never see such a thing, and I have no idea why they did that!
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
GST_PLAY_FLAG_VIDEO = (1 << 0),
|
|
|
|
GST_PLAY_FLAG_AUDIO = (1 << 1),
|
|
|
|
GST_PLAY_FLAG_TEXT = (1 << 2),
|
|
|
|
GST_PLAY_FLAG_VIS = (1 << 3),
|
|
|
|
GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4),
|
|
|
|
GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5),
|
|
|
|
GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6),
|
|
|
|
GST_PLAY_FLAG_DOWNLOAD = (1 << 7),
|
|
|
|
GST_PLAY_FLAG_BUFFERING = (1 << 8),
|
|
|
|
GST_PLAY_FLAG_DEINTERLACE = (1 << 9)
|
|
|
|
} GstPlayFlags;
|
|
|
|
|
|
|
|
|
|
|
|
static int get_int(CMEDIAPLAYER *_object, char *name)
|
|
|
|
{
|
|
|
|
int value;
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), name, &value, NULL);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_int(CMEDIAPLAYER *_object, char *name, int value)
|
|
|
|
{
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), name, value, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int get_int64(CMEDIAPLAYER *_object, char *name)
|
|
|
|
{
|
|
|
|
gint64 value;
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), name, &value, NULL);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_int64(CMEDIAPLAYER *_object, char *name, gint64 value)
|
|
|
|
{
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), name, value, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static double get_double(CMEDIAPLAYER *_object, char *name)
|
|
|
|
{
|
|
|
|
double value;
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), name, &value, NULL);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_double(CMEDIAPLAYER *_object, char *name, double value)
|
|
|
|
{
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), name, value, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean get_boolean(CMEDIAPLAYER *_object, char *name)
|
|
|
|
{
|
|
|
|
gboolean value;
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), name, &value, NULL);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_boolean(CMEDIAPLAYER *_object, char *name, gboolean value)
|
|
|
|
{
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), name, value, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *get_string(CMEDIAPLAYER *_object, char *name)
|
|
|
|
{
|
|
|
|
gchar *value;
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), name, &value, NULL);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_string(CMEDIAPLAYER *_object, char *name, gchar *value)
|
|
|
|
{
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), name, value, NULL);
|
|
|
|
}
|
|
|
|
|
2012-05-01 22:49:32 +02:00
|
|
|
static CMEDIACONTROL *get_control(CMEDIAPLAYER *_object, char *name)
|
|
|
|
{
|
|
|
|
GstElement *value;
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), name, &value, NULL);
|
|
|
|
return MEDIA_get_control_from_element(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_control(CMEDIAPLAYER *_object, char *name, CMEDIACONTROL *control)
|
|
|
|
{
|
|
|
|
GstElement *elt;
|
|
|
|
GstBin *parent;
|
|
|
|
|
|
|
|
if (!control)
|
|
|
|
{
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), name, NULL, NULL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
elt = control->elt;
|
|
|
|
parent = GST_BIN(gst_element_get_parent(elt));
|
|
|
|
if (parent)
|
|
|
|
{
|
|
|
|
gst_object_ref(elt);
|
|
|
|
gst_bin_remove(parent, elt);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), name, elt, NULL);
|
|
|
|
|
|
|
|
if (parent)
|
|
|
|
gst_object_unref(elt);
|
|
|
|
}
|
|
|
|
|
2012-05-01 02:42:37 +02:00
|
|
|
static bool get_flag(CMEDIAPLAYER *_object, int flag)
|
|
|
|
{
|
|
|
|
GstPlayFlags flags;
|
|
|
|
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), "flags", &flags, NULL);
|
|
|
|
return (flags & flag) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_flag(CMEDIAPLAYER *_object, int flag, bool value)
|
|
|
|
{
|
|
|
|
GstPlayFlags flags;
|
|
|
|
|
|
|
|
g_object_get(G_OBJECT(ELEMENT), "flags", &flags, NULL);
|
|
|
|
if (value)
|
|
|
|
flags |= flag;
|
|
|
|
else
|
|
|
|
flags &= ~flag;
|
|
|
|
g_object_set(G_OBJECT(ELEMENT), "flags", flags, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define IMPLEMENT_FLAG(_func, _flag) \
|
|
|
|
BEGIN_PROPERTY(_func) \
|
|
|
|
\
|
|
|
|
if (READ_PROPERTY) \
|
|
|
|
GB.ReturnBoolean(get_flag(THIS, _flag)); \
|
|
|
|
else \
|
|
|
|
set_flag(THIS, _flag, VPROP(GB_BOOLEAN)); \
|
|
|
|
\
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
//---- MediaPlayerAudio --------------------------------------------------
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerAudio_Count)
|
|
|
|
|
|
|
|
GB.ReturnInteger(get_int(THIS, "n-audio"));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerAudio_Current)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
2012-05-03 01:22:13 +02:00
|
|
|
GB.ReturnInteger(get_int(THIS, "current-audio"));
|
2012-05-01 02:42:37 +02:00
|
|
|
else
|
2012-05-03 01:22:13 +02:00
|
|
|
set_int(THIS, "current-audio", VPROP(GB_INTEGER));
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
IMPLEMENT_FLAG(MediaPlayerAudio_Enabled, GST_PLAY_FLAG_AUDIO)
|
|
|
|
IMPLEMENT_FLAG(MediaPlayerAudio_SoftwareVolume, GST_PLAY_FLAG_SOFT_VOLUME)
|
|
|
|
IMPLEMENT_FLAG(MediaPlayerAudio_NativeOnly, GST_PLAY_FLAG_NATIVE_AUDIO)
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerAudio_Volume)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnFloat(get_double(THIS, "volume"));
|
|
|
|
else
|
|
|
|
set_double(THIS, "volume", VPROP(GB_FLOAT));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerAudio_Mute)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
2012-05-03 01:22:13 +02:00
|
|
|
GB.ReturnBoolean(get_boolean(THIS, "mute"));
|
2012-05-01 02:42:37 +02:00
|
|
|
else
|
2012-05-03 01:22:13 +02:00
|
|
|
set_boolean(THIS, "mute", VPROP(GB_BOOLEAN) != 0);
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerAudio_Offset)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnFloat(TO_SECOND(get_int64(THIS, "av-offset")));
|
|
|
|
else
|
|
|
|
set_int64(THIS, "av-offset", TO_TIME(VPROP(GB_FLOAT)));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
2012-05-01 22:49:32 +02:00
|
|
|
BEGIN_PROPERTY(MediaPlayerAudio_Output)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnObject(get_control(THIS, "audio-sink"));
|
|
|
|
else
|
|
|
|
set_control(THIS, "audio-sink", VPROP(GB_OBJECT));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
2012-05-01 02:42:37 +02:00
|
|
|
//---- MediaPlayerVideo --------------------------------------------------
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerVideo_Count)
|
|
|
|
|
|
|
|
GB.ReturnInteger(get_int(THIS, "n-video"));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerVideo_Current)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
2012-05-03 01:22:13 +02:00
|
|
|
GB.ReturnInteger(get_int(THIS, "current-video"));
|
2012-05-01 02:42:37 +02:00
|
|
|
else
|
2012-05-03 01:22:13 +02:00
|
|
|
set_int(THIS, "current-video", VPROP(GB_INTEGER));
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
IMPLEMENT_FLAG(MediaPlayerVideo_Enabled, GST_PLAY_FLAG_VIDEO)
|
|
|
|
IMPLEMENT_FLAG(MediaPlayerVideo_NativeOnly, GST_PLAY_FLAG_NATIVE_VIDEO)
|
|
|
|
IMPLEMENT_FLAG(MediaPlayerVideo_Deinterlace, GST_PLAY_FLAG_DEINTERLACE)
|
|
|
|
|
2012-05-01 22:49:32 +02:00
|
|
|
BEGIN_PROPERTY(MediaPlayerVideo_Output)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnObject(get_control(THIS, "video-sink"));
|
|
|
|
else
|
|
|
|
set_control(THIS, "video-sink", VPROP(GB_OBJECT));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerVideo_Visualisation)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnObject(get_control(THIS, "vis-plugin"));
|
|
|
|
else
|
|
|
|
{
|
2012-05-03 01:22:13 +02:00
|
|
|
CMEDIACONTROL *vis = VPROP(GB_OBJECT);
|
|
|
|
CMEDIACONTROL *old = get_control(THIS, "vis-plugin");
|
|
|
|
bool playing;
|
|
|
|
|
|
|
|
set_flag(THIS, GST_PLAY_FLAG_VIS, FALSE);
|
|
|
|
|
|
|
|
playing = THIS->base.state == GST_STATE_PLAYING;
|
|
|
|
if (playing)
|
|
|
|
MEDIA_set_state(THIS, GST_STATE_PAUSED, FALSE);
|
|
|
|
|
|
|
|
//set_control(THIS, "vis-plugin", NULL);
|
|
|
|
//if (vis)
|
|
|
|
set_control(THIS, "vis-plugin", vis);
|
|
|
|
if (vis) set_flag(THIS, GST_PLAY_FLAG_VIS, TRUE);
|
|
|
|
|
|
|
|
if (playing)
|
|
|
|
MEDIA_set_state(THIS, GST_STATE_PLAYING, FALSE);
|
2012-05-01 22:49:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
2012-05-01 02:42:37 +02:00
|
|
|
//---- MediaPlayerSubtitles ----------------------------------------------
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerSubtitles_Count)
|
|
|
|
|
|
|
|
GB.ReturnInteger(get_int(THIS, "n-text"));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerSubtitles_Current)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
2012-05-03 01:22:13 +02:00
|
|
|
GB.ReturnInteger(get_int(THIS, "current-text"));
|
2012-05-01 02:42:37 +02:00
|
|
|
else
|
2012-05-03 01:22:13 +02:00
|
|
|
set_int(THIS, "current-text", VPROP(GB_INTEGER));
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
IMPLEMENT_FLAG(MediaPlayerSubtitles_Enabled, GST_PLAY_FLAG_TEXT)
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerSubtitles_Charset)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
{
|
|
|
|
char *charset = get_string(THIS, "subtitle-encoding");
|
|
|
|
GB.ReturnNewZeroString(charset);
|
|
|
|
g_free(charset);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
set_string(THIS, "subtitle-encoding", GB.ToZeroString(PROP(GB_STRING)));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayerSubtitles_URL)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
{
|
|
|
|
char *charset = get_string(THIS, "suburi");
|
|
|
|
GB.ReturnNewZeroString(charset);
|
|
|
|
g_free(charset);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
set_string(THIS, "suburi", GB.ToZeroString(PROP(GB_STRING)));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
2012-05-01 22:49:32 +02:00
|
|
|
BEGIN_PROPERTY(MediaPlayerSubtitles_Output)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnObject(get_control(THIS, "text-sink"));
|
|
|
|
else
|
|
|
|
set_control(THIS, "text-sink", VPROP(GB_OBJECT));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
2012-04-30 11:48:38 +02:00
|
|
|
//---- MediaPlayer -------------------------------------------------------
|
|
|
|
|
2012-05-01 02:42:37 +02:00
|
|
|
DECLARE_EVENT(EVENT_AboutToFinish);
|
|
|
|
DECLARE_EVENT(EVENT_AudioChanged);
|
|
|
|
DECLARE_EVENT(EVENT_SubtitlesChanged);
|
|
|
|
DECLARE_EVENT(EVENT_VideoChanged);
|
2012-05-01 22:49:32 +02:00
|
|
|
//DECLARE_EVENT(EVENT_SourceSetup);
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
static void cb_about_to_finish(void *playbin, void *_object)
|
|
|
|
{
|
|
|
|
MEDIA_raise_event(THIS, EVENT_AboutToFinish);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cb_audio_changed(void *playbin, void *_object)
|
|
|
|
{
|
|
|
|
MEDIA_raise_event(THIS, EVENT_AudioChanged);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cb_text_changed(void *playbin, void *_object)
|
|
|
|
{
|
|
|
|
MEDIA_raise_event(THIS, EVENT_SubtitlesChanged);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cb_video_changed(void *playbin, void *_object)
|
|
|
|
{
|
|
|
|
MEDIA_raise_event(THIS, EVENT_VideoChanged);
|
|
|
|
}
|
|
|
|
|
2012-05-01 22:49:32 +02:00
|
|
|
/*static void cb_source_setup(void *playbin, GstElement *source, void *_object)
|
2012-05-01 02:42:37 +02:00
|
|
|
{
|
|
|
|
MEDIA_raise_event(THIS, EVENT_SourceSetup);
|
2012-05-01 22:49:32 +02:00
|
|
|
}*/
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
BEGIN_METHOD_VOID(MediaPlayer_new)
|
|
|
|
|
|
|
|
g_signal_connect(ELEMENT, "about-to-finish", G_CALLBACK(cb_about_to_finish), THIS);
|
|
|
|
g_signal_connect(ELEMENT, "audio-changed", G_CALLBACK(cb_audio_changed), THIS);
|
|
|
|
g_signal_connect(ELEMENT, "text-changed", G_CALLBACK(cb_text_changed), THIS);
|
|
|
|
g_signal_connect(ELEMENT, "video-changed", G_CALLBACK(cb_video_changed), THIS);
|
2012-05-01 22:49:32 +02:00
|
|
|
//g_signal_connect(ELEMENT, "source-setup", G_CALLBACK(cb_source_setup), THIS);
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
END_METHOD
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayer_ConnectionSpeed)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnInteger(get_int(THIS, "connection-speed"));
|
|
|
|
else
|
|
|
|
set_int(THIS, "connection-speed", VPROP(GB_INTEGER));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
|
|
|
IMPLEMENT_FLAG(MediaPlayer_ProgressiveDownload, GST_PLAY_FLAG_DOWNLOAD)
|
|
|
|
IMPLEMENT_FLAG(MediaPlayer_Buffering, GST_PLAY_FLAG_BUFFERING)
|
|
|
|
|
|
|
|
BEGIN_PROPERTY(MediaPlayer_URL)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
{
|
|
|
|
char *charset = get_string(THIS, "uri");
|
|
|
|
GB.ReturnNewZeroString(charset);
|
|
|
|
g_free(charset);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
set_string(THIS, "uri", GB.ToZeroString(PROP(GB_STRING)));
|
|
|
|
|
|
|
|
END_PROPERTY
|
2012-04-30 11:48:38 +02:00
|
|
|
|
2012-05-01 22:49:32 +02:00
|
|
|
BEGIN_PROPERTY(MediaPlayer_Input)
|
|
|
|
|
|
|
|
if (READ_PROPERTY)
|
|
|
|
GB.ReturnObject(get_control(THIS, "source"));
|
|
|
|
else
|
|
|
|
set_control(THIS, "source", VPROP(GB_OBJECT));
|
|
|
|
|
|
|
|
END_PROPERTY
|
|
|
|
|
2012-04-30 11:48:38 +02:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2012-05-01 02:42:37 +02:00
|
|
|
GB_DESC MediaPlayerAudioDesc[] =
|
|
|
|
{
|
|
|
|
GB_DECLARE(".MediaPlayer.Audio", sizeof(CMEDIAPLAYER)),
|
|
|
|
GB_VIRTUAL_CLASS(),
|
|
|
|
|
|
|
|
GB_PROPERTY_READ("Count", "i", MediaPlayerAudio_Count),
|
|
|
|
GB_PROPERTY("Current", "i", MediaPlayerAudio_Current),
|
|
|
|
GB_PROPERTY("Enabled", "b", MediaPlayerAudio_Enabled),
|
|
|
|
GB_PROPERTY("SoftwareVolume", "b", MediaPlayerAudio_SoftwareVolume),
|
|
|
|
GB_PROPERTY("NativeOnly", "b", MediaPlayerAudio_NativeOnly),
|
|
|
|
GB_PROPERTY("Volume", "f", MediaPlayerAudio_Volume),
|
|
|
|
GB_PROPERTY("Mute", "b", MediaPlayerAudio_Mute),
|
|
|
|
GB_PROPERTY("Offset", "f", MediaPlayerAudio_Offset),
|
2012-05-01 22:49:32 +02:00
|
|
|
GB_PROPERTY("Output", "MediaControl", MediaPlayerAudio_Output),
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
GB_END_DECLARE
|
|
|
|
};
|
|
|
|
|
|
|
|
GB_DESC MediaPlayerVideoDesc[] =
|
|
|
|
{
|
|
|
|
GB_DECLARE(".MediaPlayer.Video", sizeof(CMEDIAPLAYER)),
|
|
|
|
GB_VIRTUAL_CLASS(),
|
|
|
|
|
|
|
|
GB_PROPERTY_READ("Count", "i", MediaPlayerVideo_Count),
|
|
|
|
GB_PROPERTY("Current", "i", MediaPlayerVideo_Current),
|
|
|
|
GB_PROPERTY("Enabled", "b", MediaPlayerVideo_Enabled),
|
|
|
|
GB_PROPERTY("NativeOnly", "b", MediaPlayerVideo_NativeOnly),
|
|
|
|
GB_PROPERTY("Deinterlace", "b", MediaPlayerVideo_Deinterlace),
|
2012-05-01 22:49:32 +02:00
|
|
|
GB_PROPERTY("Output", "MediaControl", MediaPlayerVideo_Output),
|
|
|
|
GB_PROPERTY("Visualisation", "MediaControl", MediaPlayerVideo_Visualisation),
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
GB_END_DECLARE
|
|
|
|
};
|
|
|
|
|
|
|
|
GB_DESC MediaPlayerSubtitlesDesc[] =
|
|
|
|
{
|
|
|
|
GB_DECLARE(".MediaPlayer.Subtitles", sizeof(CMEDIAPLAYER)),
|
|
|
|
GB_VIRTUAL_CLASS(),
|
|
|
|
|
|
|
|
GB_PROPERTY_READ("Count", "i", MediaPlayerSubtitles_Count),
|
|
|
|
GB_PROPERTY("Current", "i", MediaPlayerSubtitles_Current),
|
|
|
|
GB_PROPERTY("Enabled", "b", MediaPlayerSubtitles_Enabled),
|
|
|
|
GB_PROPERTY("Charset", "s", MediaPlayerSubtitles_Charset),
|
|
|
|
GB_PROPERTY("URL", "s", MediaPlayerSubtitles_URL),
|
2012-05-01 22:49:32 +02:00
|
|
|
GB_PROPERTY("Output", "MediaControl", MediaPlayerSubtitles_Output),
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
GB_END_DECLARE
|
|
|
|
};
|
|
|
|
|
2012-04-30 11:48:38 +02:00
|
|
|
GB_DESC MediaPlayerDesc[] =
|
|
|
|
{
|
|
|
|
GB_DECLARE("MediaPlayer", sizeof(CMEDIAPLAYER)),
|
|
|
|
GB_INHERITS("MediaPipeline"),
|
|
|
|
|
2012-05-01 02:42:37 +02:00
|
|
|
GB_METHOD("_new", NULL, MediaPlayer_new, NULL),
|
|
|
|
|
|
|
|
GB_PROPERTY_SELF("Audio", ".MediaPlayer.Audio"),
|
|
|
|
GB_PROPERTY_SELF("Video", ".MediaPlayer.Video"),
|
|
|
|
GB_PROPERTY_SELF("Subtitles", ".MediaPlayer.Subtitles"),
|
2012-05-01 22:49:32 +02:00
|
|
|
GB_PROPERTY_SELF("Visualisation", ".MediaPlayer.Visualisation"),
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
GB_PROPERTY("ConnectionSpeed", "i", MediaPlayer_ConnectionSpeed),
|
|
|
|
GB_PROPERTY("ProgressiveDownload", "b", MediaPlayer_ProgressiveDownload),
|
|
|
|
GB_PROPERTY("Buffering", "b", MediaPlayer_Buffering),
|
|
|
|
GB_PROPERTY("URL", "s", MediaPlayer_URL),
|
2012-05-01 22:49:32 +02:00
|
|
|
GB_PROPERTY("Input", "MediaControl", MediaPlayer_Input),
|
2012-05-01 02:42:37 +02:00
|
|
|
|
|
|
|
GB_EVENT("AboutToFinish", NULL, NULL, &EVENT_AboutToFinish),
|
|
|
|
GB_EVENT("AudioChanged", NULL, NULL, &EVENT_AudioChanged),
|
|
|
|
GB_EVENT("SubtitlesChanged", NULL, NULL, &EVENT_SubtitlesChanged),
|
|
|
|
GB_EVENT("VideoChanged", NULL, NULL, &EVENT_VideoChanged),
|
2012-05-01 22:49:32 +02:00
|
|
|
//GB_EVENT("SourceSetup", NULL, NULL, &EVENT_SourceSetup),
|
2012-05-01 02:42:37 +02:00
|
|
|
|
2012-04-30 11:48:38 +02:00
|
|
|
GB_END_DECLARE
|
|
|
|
};
|
|
|
|
|