mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
changing 'channel' to 'track' to avoid naming overlap
Original commit message from CVS: changing 'channel' to 'track' to avoid naming overlap
This commit is contained in:
parent
cd8887968f
commit
32dc5f21d4
2 changed files with 66 additions and 60 deletions
|
@ -59,7 +59,7 @@ static void
|
||||||
gst_mixer_class_init (GstMixerClass *klass)
|
gst_mixer_class_init (GstMixerClass *klass)
|
||||||
{
|
{
|
||||||
/* default virtual functions */
|
/* default virtual functions */
|
||||||
klass->list_channels = NULL;
|
klass->list_tracks = NULL;
|
||||||
klass->set_volume = NULL;
|
klass->set_volume = NULL;
|
||||||
klass->get_volume = NULL;
|
klass->get_volume = NULL;
|
||||||
klass->set_mute = NULL;
|
klass->set_mute = NULL;
|
||||||
|
@ -67,12 +67,12 @@ gst_mixer_class_init (GstMixerClass *klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
const GList *
|
const GList *
|
||||||
gst_mixer_list_channels (GstMixer *mixer)
|
gst_mixer_list_tracks (GstMixer *mixer)
|
||||||
{
|
{
|
||||||
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
||||||
|
|
||||||
if (klass->list_channels) {
|
if (klass->list_tracks) {
|
||||||
return klass->list_channels (mixer);
|
return klass->list_tracks (mixer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -80,29 +80,29 @@ gst_mixer_list_channels (GstMixer *mixer)
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_mixer_set_volume (GstMixer *mixer,
|
gst_mixer_set_volume (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gint *volumes)
|
gint *volumes)
|
||||||
{
|
{
|
||||||
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
||||||
|
|
||||||
if (klass->set_volume) {
|
if (klass->set_volume) {
|
||||||
klass->set_volume (mixer, channel, volumes);
|
klass->set_volume (mixer, track, volumes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_mixer_get_volume (GstMixer *mixer,
|
gst_mixer_get_volume (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gint *volumes)
|
gint *volumes)
|
||||||
{
|
{
|
||||||
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
||||||
|
|
||||||
if (klass->get_volume) {
|
if (klass->get_volume) {
|
||||||
klass->get_volume (mixer, channel, volumes);
|
klass->get_volume (mixer, track, volumes);
|
||||||
} else {
|
} else {
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
for (i = 0; i < channel->num_channels; i++) {
|
for (i = 0; i < track->num_channels; i++) {
|
||||||
volumes[i] = 0;
|
volumes[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,24 +110,24 @@ gst_mixer_get_volume (GstMixer *mixer,
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_mixer_set_mute (GstMixer *mixer,
|
gst_mixer_set_mute (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gboolean mute)
|
gboolean mute)
|
||||||
{
|
{
|
||||||
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
||||||
|
|
||||||
if (klass->set_mute) {
|
if (klass->set_mute) {
|
||||||
klass->set_mute (mixer, channel, mute);
|
klass->set_mute (mixer, track, mute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_mixer_set_record (GstMixer *mixer,
|
gst_mixer_set_record (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gboolean record)
|
gboolean record)
|
||||||
{
|
{
|
||||||
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer);
|
||||||
|
|
||||||
if (klass->set_record) {
|
if (klass->set_record) {
|
||||||
klass->set_record (mixer, channel, record);
|
klass->set_record (mixer, track, record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,27 +39,33 @@ G_BEGIN_DECLS
|
||||||
#define GST_MIXER_GET_CLASS(inst) \
|
#define GST_MIXER_GET_CLASS(inst) \
|
||||||
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass))
|
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_MIXER, GstMixerClass))
|
||||||
|
|
||||||
/* I fully realise that this naming being used here is confusing.
|
/* In this interface, a `track' is a unit of recording or playback, pretty much
|
||||||
* A channel is referred to both as the number of simultaneous
|
* equivalent to what comes in or goes out through a GstPad. Each track can have
|
||||||
* sound streams the input can handle as well as the in-/output
|
* one or more `channels', which are logical parts of the track. A `stereo
|
||||||
* itself. We need to fix this some day, I just cannot come up
|
* track', then, would be one stream with two channels, while a `mono track'
|
||||||
* with something better.
|
* would be a stream with a single channel. More complex examples are possible
|
||||||
|
* as well ; for example, professional audio hardware might handle audio tracks
|
||||||
|
* with 8 or 16 channels each.
|
||||||
|
*
|
||||||
|
* All these are audio terms. I don't know exactly what this would translate to
|
||||||
|
* for video, but a track might be an entire video stream, and a channel might
|
||||||
|
* be the information for one of the colors in the stream.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GST_MIXER_CHANNEL_INPUT (1<<0)
|
#define GST_MIXER_TRACK_INPUT (1<<0)
|
||||||
#define GST_MIXER_CHANNEL_OUTPUT (1<<1)
|
#define GST_MIXER_TRACK_OUTPUT (1<<1)
|
||||||
#define GST_MIXER_CHANNEL_MUTE (1<<2)
|
#define GST_MIXER_TRACK_MUTE (1<<2)
|
||||||
#define GST_MIXER_CHANNEL_RECORD (1<<3)
|
#define GST_MIXER_TRACK_RECORD (1<<3)
|
||||||
|
|
||||||
typedef struct _GstMixerChannel {
|
typedef struct _GstMixerTrack {
|
||||||
gchar *label;
|
gchar *label;
|
||||||
gint num_channels,
|
gint num_channels,
|
||||||
flags,
|
flags,
|
||||||
min_volume, max_volume;
|
min_volume, max_volume;
|
||||||
} GstMixerChannel;
|
} GstMixerTrack;
|
||||||
|
|
||||||
#define GST_MIXER_CHANNEL_HAS_FLAG(channel, flag) \
|
#define GST_MIXER_TRACK_HAS_FLAG(track, flag) \
|
||||||
((channel)->flags & flag)
|
((track)->flags & flag)
|
||||||
|
|
||||||
typedef struct _GstMixer GstMixer;
|
typedef struct _GstMixer GstMixer;
|
||||||
|
|
||||||
|
@ -67,20 +73,20 @@ typedef struct _GstMixerClass {
|
||||||
GTypeInterface klass;
|
GTypeInterface klass;
|
||||||
|
|
||||||
/* virtual functions */
|
/* virtual functions */
|
||||||
const GList * (* list_channels) (GstMixer *mixer);
|
const GList * (* list_tracks) (GstMixer *mixer);
|
||||||
|
|
||||||
void (* set_volume) (GstMixer *mixer,
|
void (* set_volume) (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gint *volumes);
|
gint *volumes);
|
||||||
void (* get_volume) (GstMixer *mixer,
|
void (* get_volume) (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gint *volumes);
|
gint *volumes);
|
||||||
|
|
||||||
void (* set_mute) (GstMixer *mixer,
|
void (* set_mute) (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gboolean mute);
|
gboolean mute);
|
||||||
void (* set_record) (GstMixer *mixer,
|
void (* set_record) (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gboolean record);
|
gboolean record);
|
||||||
|
|
||||||
GST_CLASS_PADDING
|
GST_CLASS_PADDING
|
||||||
|
@ -89,18 +95,18 @@ typedef struct _GstMixerClass {
|
||||||
GType gst_mixer_get_type (void);
|
GType gst_mixer_get_type (void);
|
||||||
|
|
||||||
/* virtual class function wrappers */
|
/* virtual class function wrappers */
|
||||||
const GList * gst_mixer_list_channels (GstMixer *mixer);
|
const GList * gst_mixer_list_tracks (GstMixer *mixer);
|
||||||
void gst_mixer_set_volume (GstMixer *mixer,
|
void gst_mixer_set_volume (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gint *volumes);
|
gint *volumes);
|
||||||
void gst_mixer_get_volume (GstMixer *mixer,
|
void gst_mixer_get_volume (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gint *volumes);
|
gint *volumes);
|
||||||
void gst_mixer_set_mute (GstMixer *mixer,
|
void gst_mixer_set_mute (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gboolean mute);
|
gboolean mute);
|
||||||
void gst_mixer_set_record (GstMixer *mixer,
|
void gst_mixer_set_record (GstMixer *mixer,
|
||||||
GstMixerChannel *channel,
|
GstMixerTrack *track,
|
||||||
gboolean record);
|
gboolean record);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
Loading…
Reference in a new issue