docs/random/mimetypes: update docs for audio/x-raw-float. Add "buffer-frames=0 means undefined"

Original commit message from CVS:
2004-01-29  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* docs/random/mimetypes:
update docs for audio/x-raw-float. Add "buffer-frames=0 means
undefined"
* gst/elements/gstfilesrc.c: (gst_filesrc_set_location):
make it only work in NULL.
* gst/gstcaps.c:
don't posion NULL caps
* gst/gstelement.c: (gst_element_set_time):
add debugging statement
* gst/gstelement.c: (gst_element_emit_found_tag),
(gst_element_found_tag_func), (gst_element_found_tags):
* gst/gstelement.h:
These functions take const taglists
* gst/gstpad.c: (gst_pad_proxy_getcaps):
fix memleak
* gst/gstpad.c: (gst_pad_event_default):
make more effort on handling discont and clocks, g_warn if everything
fails
* gst/gststructure.c: (gst_structure_remove_fields),
(gst_structure_remove_fields_valist):
* gst/gststructure.h:
add gst_structure_remove_fields(_valist)
* gst/gsttag.c:
fix doc glitch
This commit is contained in:
Benjamin Otte 2004-01-29 02:24:52 +00:00
parent a842daf05e
commit 807937481e
12 changed files with 121 additions and 26 deletions

View file

@ -1,3 +1,30 @@
2004-01-29 Benjamin Otte <in7y118@public.uni-hamburg.de>
* docs/random/mimetypes:
update docs for audio/x-raw-float. Add "buffer-frames=0 means
undefined"
* gst/elements/gstfilesrc.c: (gst_filesrc_set_location):
make it only work in NULL.
* gst/gstcaps.c:
don't posion NULL caps
* gst/gstelement.c: (gst_element_set_time):
add debugging statement
* gst/gstelement.c: (gst_element_emit_found_tag),
(gst_element_found_tag_func), (gst_element_found_tags):
* gst/gstelement.h:
These functions take const taglists
* gst/gstpad.c: (gst_pad_proxy_getcaps):
fix memleak
* gst/gstpad.c: (gst_pad_event_default):
make more effort on handling discont and clocks, g_warn if everything
fails
* gst/gststructure.c: (gst_structure_remove_fields),
(gst_structure_remove_fields_valist):
* gst/gststructure.h:
add gst_structure_remove_fields(_valist)
* gst/gsttag.c:
fix doc glitch
2004-01-28 David Schleef <ds@schleef.org> 2004-01-28 David Schleef <ds@schleef.org>
* docs/random/ds/element-checklist: Notes about gst_caps_to_string() * docs/random/ds/element-checklist: Notes about gst_caps_to_string()

View file

@ -357,9 +357,10 @@ Preface - (optional) properties for all audio formats:
2 - Raw Audio (floating point format) 2 - Raw Audio (floating point format)
mimetype: audio/x-raw-float mimetype: audio/x-raw-float
properties: 'depth' = X (INT) <- 32=float, 64=double properties: 'width' = X (INT) <- 32=float, 64=double
'endianness' = 1234/4321 (INT) <- use G_BIG/LITTLE_ENDIAN! 'endianness' = 1234/4321 (INT) <- use G_BIG/LITTLE_ENDIAN!
'buffer-frames' = (INT) 'buffer-frames' = (INT)
number of samples per buffer, 0 means undefined
With regards to the signal: 0.0 represents no signal, +/- 1.0 is 0 dB. With regards to the signal: 0.0 represents no signal, +/- 1.0 is 0 dB.
3 - Alaw Raw Audio 3 - Alaw Raw Audio

View file

@ -257,7 +257,7 @@ static gboolean
gst_filesrc_set_location (GstFileSrc *src, const gchar *location) gst_filesrc_set_location (GstFileSrc *src, const gchar *location)
{ {
/* the element must be stopped in order to do this */ /* the element must be stopped in order to do this */
if (GST_STATE (src) == GST_STATE_PLAYING) if (GST_STATE (src) != GST_STATE_NULL)
return FALSE; return FALSE;
if (src->filename) g_free (src->filename); if (src->filename) g_free (src->filename);

View file

@ -24,16 +24,20 @@
#include <gst/gst.h> #include <gst/gst.h>
#define CAPS_POISON(caps) do{ \ #define CAPS_POISON(caps) G_STMT_START{ \
GstCaps *_newcaps = gst_caps_copy (caps); \ if (caps) { \
gst_caps_free(caps); \ GstCaps *_newcaps = gst_caps_copy (caps); \
caps = _newcaps; \ gst_caps_free(caps); \
} while (0) caps = _newcaps; \
#define STRUCTURE_POISON(structure) do{ \ } \
GstStructure *_newstruct = gst_structure_copy (structure); \ } G_STMT_END
gst_structure_free(structure); \ #define STRUCTURE_POISON(structure) G_STMT_START{ \
structure = _newstruct; \ if (structure) { \
} while (0) GstStructure *_newstruct = gst_structure_copy (structure); \
gst_structure_free(structure); \
structure = _newstruct; \
} \
} G_STMT_END
static void _gst_caps_transform_to_string (const GValue *src_value, static void _gst_caps_transform_to_string (const GValue *src_value,

View file

@ -69,7 +69,7 @@ static void gst_element_dispose (GObject *object);
static GstElementStateReturn gst_element_change_state (GstElement *element); static GstElementStateReturn gst_element_change_state (GstElement *element);
static void gst_element_error_func (GstElement* element, GstElement *source, GError *error, gchar *debug); static void gst_element_error_func (GstElement* element, GstElement *source, GError *error, gchar *debug);
static void gst_element_found_tag_func (GstElement* element, GstElement *source, GstTagList *tag_list); static void gst_element_found_tag_func (GstElement* element, GstElement *source, const GstTagList *tag_list);
#ifndef GST_DISABLE_LOADSAVE #ifndef GST_DISABLE_LOADSAVE
static xmlNodePtr gst_element_save_thyself (GstObject *object, xmlNodePtr parent); static xmlNodePtr gst_element_save_thyself (GstObject *object, xmlNodePtr parent);
@ -896,7 +896,8 @@ gst_element_set_time (GstElement *element, GstClockTime time)
break; break;
case GST_STATE_PLAYING: case GST_STATE_PLAYING:
event_time = gst_clock_get_event_time (element->clock); event_time = gst_clock_get_event_time (element->clock);
GST_LOG_OBJECT (element, "clock time %llu: setting element time to %llu", event_time, time); GST_CAT_LOG_OBJECT (GST_CAT_CLOCK, element,
"clock time %llu: setting element time to %llu", event_time, time);
element->base_time = event_time - time; element->base_time = event_time - time;
break; break;
default: default:
@ -3193,14 +3194,14 @@ gst_element_set_loop_function (GstElement *element,
} }
} }
static inline void static inline void
gst_element_emit_found_tag (GstElement* element, GstElement *source, GstTagList *tag_list) gst_element_emit_found_tag (GstElement* element, GstElement *source, const GstTagList *tag_list)
{ {
gst_object_ref (GST_OBJECT (element)); gst_object_ref (GST_OBJECT (element));
g_signal_emit (element, gst_element_signals[FOUND_TAG], 0, source, tag_list); g_signal_emit (element, gst_element_signals[FOUND_TAG], 0, source, tag_list);
gst_object_unref (GST_OBJECT (element)); gst_object_unref (GST_OBJECT (element));
} }
static void static void
gst_element_found_tag_func (GstElement* element, GstElement *source, GstTagList *tag_list) gst_element_found_tag_func (GstElement* element, GstElement *source, const GstTagList *tag_list)
{ {
/* tell the parent */ /* tell the parent */
if (GST_OBJECT_PARENT (element)) { if (GST_OBJECT_PARENT (element)) {
@ -3220,7 +3221,7 @@ gst_element_found_tag_func (GstElement* element, GstElement *source, GstTagList
* not when you handle an event. * not when you handle an event.
*/ */
void void
gst_element_found_tags (GstElement *element, GstTagList *tag_list) gst_element_found_tags (GstElement *element, const GstTagList *tag_list)
{ {
gst_element_emit_found_tag (element, element, tag_list); gst_element_emit_found_tag (element, element, tag_list);
} }

View file

@ -204,7 +204,7 @@ struct _GstElementClass {
void (*pad_removed) (GstElement *element, GstPad *pad); void (*pad_removed) (GstElement *element, GstPad *pad);
void (*error) (GstElement *element, GstElement *source, GError *error, gchar *debug); void (*error) (GstElement *element, GstElement *source, GError *error, gchar *debug);
void (*eos) (GstElement *element); void (*eos) (GstElement *element);
void (*found_tag) (GstElement *element, GstElement *source, GstTagList *tag_list); void (*found_tag) (GstElement *element, GstElement *source, const GstTagList *tag_list);
/* local pointers for get/set */ /* local pointers for get/set */
void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); void (*set_property) (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
@ -359,7 +359,7 @@ gboolean gst_element_convert (GstElement *element,
GstFormat src_format, gint64 src_value, GstFormat src_format, gint64 src_value,
GstFormat *dest_format, gint64 *dest_value); GstFormat *dest_format, gint64 *dest_value);
void gst_element_found_tags (GstElement *element, GstTagList *tag_list); void gst_element_found_tags (GstElement *element, const GstTagList *tag_list);
void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstClockTime timestamp, void gst_element_found_tags_for_pad (GstElement *element, GstPad *pad, GstClockTime timestamp,
GstTagList *list); GstTagList *list);

View file

@ -2118,8 +2118,10 @@ gst_pad_proxy_getcaps (GstPad *pad)
GstCaps *temp; GstCaps *temp;
if (otherpad != pad) { if (otherpad != pad) {
temp = gst_caps_intersect (caps, gst_pad_get_allowed_caps (otherpad)); GstCaps *allowed = gst_pad_get_allowed_caps (otherpad);
temp = gst_caps_intersect (caps, allowed);
gst_caps_free (caps); gst_caps_free (caps);
gst_caps_free (allowed);
caps = temp; caps = temp;
} }
@ -3508,10 +3510,21 @@ gst_pad_event_default (GstPad *pad, GstEvent *event)
{ {
guint64 time; guint64 time;
if (gst_event_discont_get_value (event, GST_FORMAT_TIME, &time)) { if (gst_element_requires_clock (element) && element->clock) {
if (gst_element_requires_clock (element) && element->clock) { if (gst_event_discont_get_value (event, GST_FORMAT_TIME, &time)) {
gst_element_set_time (element, time); gst_element_set_time (element, time);
} } else {
GstFormat format = GST_FORMAT_TIME;
guint i;
for (i = 0; i < event->event_data.discont.noffsets; i++) {
if (gst_pad_convert (pad, event->event_data.discont.offsets[i].format,
event->event_data.discont.offsets[i].value, &format, &time)) {
gst_element_set_time (element, time);
} else if (i == event->event_data.discont.noffsets) {
g_warning ("can't adjust clock to new time when time not provided");
}
}
}
} }
} }
case GST_EVENT_FLUSH: case GST_EVENT_FLUSH:

View file

@ -585,6 +585,53 @@ gst_structure_remove_field(GstStructure *structure, const gchar *fieldname)
} }
} }
/**
* gst_structure_remove_fields:
* @structure: a #GstStructure
* @fieldname: the name of the field to remove
* @...: NULL-terminated list of more fieldnames to remove
*
* Removes the field with the given names. If a field does not exist, the
* argument is ignored.
*/
void
gst_structure_remove_fields(GstStructure *structure, const gchar *fieldname, ...)
{
va_list varargs;
g_return_if_fail (structure != NULL);
g_return_if_fail (fieldname != NULL);
va_start(varargs, fieldname);
gst_structure_remove_fields_valist (structure, fieldname, varargs);
va_end(varargs);
}
/**
* gst_structure_remove_fields_valist:
* @structure: a #GstStructure
* @fieldname: the name of the field to remove
* @varargs: NULL-terminated list of more fieldnames to remove
*
* Removes the field with the given names. If a field does not exist, the
* argument is ignored.
*/
void
gst_structure_remove_fields_valist(GstStructure *structure,
const gchar *fieldname, va_list varargs)
{
gchar *field = (gchar *) fieldname;
g_return_if_fail (structure != NULL);
g_return_if_fail (fieldname != NULL);
while (field) {
gst_structure_remove_field (structure, field);
field = va_arg (varargs, char *);
}
}
/** /**
* gst_structure_remove_all_fields: * gst_structure_remove_all_fields:
* @structure: a #GstStructure * @structure: a #GstStructure

View file

@ -67,6 +67,10 @@ G_CONST_RETURN GValue *gst_structure_id_get_value(const GstStructure *structure,
G_CONST_RETURN GValue *gst_structure_get_value(const GstStructure *structure, G_CONST_RETURN GValue *gst_structure_get_value(const GstStructure *structure,
const gchar *field); const gchar *field);
void gst_structure_remove_field(GstStructure *structure, const gchar *field); void gst_structure_remove_field(GstStructure *structure, const gchar *field);
void gst_structure_remove_fields(GstStructure *structure,
const gchar *fieldname, ...);
void gst_structure_remove_fields_valist(GstStructure *structure,
const gchar *fieldname, va_list varargs);
void gst_structure_remove_all_fields(GstStructure *structure); void gst_structure_remove_all_fields(GstStructure *structure);
GType gst_structure_get_field_type(const GstStructure *structure, GType gst_structure_get_field_type(const GstStructure *structure,

View file

@ -275,7 +275,6 @@ gst_tag_lookup (GQuark entry)
* with that name is already registered, that one is used. * with that name is already registered, that one is used.
* The old registration may have used a different type however. So don't rely * The old registration may have used a different type however. So don't rely
* on your supplied values. * on your supplied values.
* If you know the type is already registered, use gst_tag_lookup instead.
* This function takes ownership of all supplied variables. * This function takes ownership of all supplied variables.
*/ */
void void

View file

@ -275,7 +275,6 @@ gst_tag_lookup (GQuark entry)
* with that name is already registered, that one is used. * with that name is already registered, that one is used.
* The old registration may have used a different type however. So don't rely * The old registration may have used a different type however. So don't rely
* on your supplied values. * on your supplied values.
* If you know the type is already registered, use gst_tag_lookup instead.
* This function takes ownership of all supplied variables. * This function takes ownership of all supplied variables.
*/ */
void void

View file

@ -257,7 +257,7 @@ static gboolean
gst_filesrc_set_location (GstFileSrc *src, const gchar *location) gst_filesrc_set_location (GstFileSrc *src, const gchar *location)
{ {
/* the element must be stopped in order to do this */ /* the element must be stopped in order to do this */
if (GST_STATE (src) == GST_STATE_PLAYING) if (GST_STATE (src) != GST_STATE_NULL)
return FALSE; return FALSE;
if (src->filename) g_free (src->filename); if (src->filename) g_free (src->filename);