2008-01-31 Sebastian Dröge <slomo@circular-chaos.org>
+ * ext/metadata/Makefile.am:
+ Add some relevant variables to CFLAGS and LIBADD, for example our
+ compiler warnings paramters.
+
+ * ext/metadata/gstbasemetadata.c:
+ (gst_base_metadata_strip_push_buffer),
+ (gst_base_metadata_calculate_offsets),
+ (gst_base_metadata_src_event), (gst_base_metadata_sink_activate):
+ * ext/metadata/gstmetadatademux.c: (gst_metadata_demux_init),
+ (gst_metadata_demux_set_property), (gst_metadata_demux_dispose):
+ * ext/metadata/gstmetadatamux.c: (gst_metadata_mux_init),
+ (gst_metadata_mux_set_property), (gst_metadata_mux_get_property),
+ (gst_metadata_mux_dispose),
+ (gst_metadata_mux_create_chunks_from_tags):
+ * ext/metadata/metadata.c: (metadata_dispose):
+ * ext/metadata/metadataexif.c:
+ (metadataparse_exif_content_foreach_entry_func),
+ (metadatamux_exif_for_each_tag_in_list):
+ * ext/metadata/metadataiptc.c:
+ (metadatamux_iptc_for_each_tag_in_list):
+ * ext/metadata/metadatamuxjpeg.c: (metadatamux_jpeg_lazy_update),
+ (metadatamux_jpeg_reading):
+ * ext/metadata/metadatamuxpng.c: (metadatamux_png_reading):
+ * ext/metadata/metadataparsejpeg.c: (metadataparse_jpeg_reading):
+ * ext/metadata/metadataparsepng.c:
+ * ext/metadata/metadataparseutil.h:
+ * ext/metadata/metadataxmp.c: (metadataparse_xmp_tag_list_add),
+ (metadatamux_xmp_create_chunk_from_tag_list):
+ Fix a million warnings that showed up after the above change.
+
+2008-01-31 Sebastian Dröge <slomo@circular-chaos.org>
+
* ext/soup/gstsouphttpsrc.c: (_do_init),
(gst_soup_http_src_base_init), (gst_soup_http_src_class_init),
(gst_soup_http_src_init), (gst_soup_http_src_dispose),
libgstmetadata_ladir = $(includedir)/gstreamer-@GST_MAJORMINOR@/metadata
libgstmetadata_la_HEADERS = metadatatags.h
-libgstmetadata_la_CFLAGS = $(METADATA_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS)
-libgstmetadata_la_LIBADD = $(METADATA_LIBS) -lgsttag-@GST_MAJORMINOR@ $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS)
+libgstmetadata_la_CFLAGS = $(METADATA_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
+libgstmetadata_la_LIBADD = $(METADATA_LIBS) -lgsttag-@GST_MAJORMINOR@ $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS)
libgstmetadata_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstmetadatademux.h \
if (inject_len) {
for (i = 0; i < inject_len; ++i) {
- int res;
-
if (inject[i].offset_orig >= offset_orig) {
if (G_LIKELY (inject_begin || inject[i].offset_orig > offset_orig)) {
if (inject[i].offset_orig < offset_orig + size_buf_in) {
striped_so_far = 0;
j = 0;
for (i = 0; i < inject_len; ++i) {
- int res;
-
while (j < strip_len) {
if (strip[j].offset_orig < inject[i].offset_orig)
striped_so_far += bsize_strip[j++];
}
-
-done:
-
if (prepend_size) {
if (injected_bytes == 0 && striped_bytes == 0) {
GstBuffer *new_buf =
gst_base_metadata_calculate_offsets (GstBaseMetadata * base)
{
int i, j;
- guint32 append_size;
guint32 bytes_striped, bytes_inject;
MetadataChunk *strip = META_DATA_STRIP_CHUNKS (base->metadata).chunk;
MetadataChunk *inject = META_DATA_INJECT_CHUNKS (base->metadata).chunk;
goto done;
start = filter->duration + start;
}
- start_type == GST_SEEK_TYPE_SET;
+ start_type = GST_SEEK_TYPE_SET;
if (filter->prepend_buffer) {
gst_buffer_unref (filter->prepend_buffer);
goto done;
stop = filter->duration + stop;
}
- stop_type == GST_SEEK_TYPE_SET;
+ stop_type = GST_SEEK_TYPE_SET;
gst_base_metadata_translate_pos_to_orig (filter, stop, &stop, NULL, 0);
ret = gst_base_metadata_pull_range_parse (filter);
}
-done:
-
if (ret) {
gst_pad_activate_pull (pad, FALSE);
gst_pad_activate_push (filter->srcpad, FALSE);
gst_metadata_demux_init (GstMetadataDemux * filter,
GstMetadataDemuxClass * gclass)
{
- GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter);
-
gst_base_metadata_set_option_flag (GST_BASE_METADATA (filter),
META_OPT_EXIF | META_OPT_IPTC | META_OPT_XMP | META_OPT_DEMUX);
-
}
static void
gst_metadata_demux_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
- GstMetadataDemux *filter = GST_METADATA_DEMUX (object);
-
switch (prop_id) {
case ARG_PARSE_ONLY:
if (g_value_get_boolean (value))
static void
gst_metadata_demux_dispose (GObject * object)
{
- GstMetadataDemux *filter = NULL;
-
G_OBJECT_CLASS (metadata_parent_class)->dispose (object);
}
static void
gst_metadata_mux_init (GstMetadataMux * filter, GstMetadataMuxClass * gclass)
{
- GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter);
-
gst_base_metadata_set_option_flag (GST_BASE_METADATA (filter),
META_OPT_EXIF | META_OPT_IPTC | META_OPT_XMP | META_OPT_MUX);
gst_metadata_mux_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
- GstMetadataMux *filter = GST_METADATA_MUX (object);
-
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gst_metadata_mux_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
- guint8 option =
- gst_base_metadata_get_option_flag (GST_BASE_METADATA (object));
-
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
static void
gst_metadata_mux_dispose (GObject * object)
{
- GstMetadataMux *filter = NULL;
-
G_OBJECT_CLASS (metadata_parent_class)->dispose (object);
}
{
GstMetadataMux *filter = GST_METADATA_MUX (base);
- GstMessage *msg;
GstTagSetter *setter = GST_TAG_SETTER (filter);
const GstTagList *taglist = gst_tag_setter_get_tag_list (setter);
- GstEvent *event;
guint8 *buf = NULL;
guint32 size = 0;
else
metadatamux_png_dispose (&(*meta_data)->format_data.png_mux);
break;
+ case IMG_NONE:
+ default:
+ break;
}
metadata_chunk_array_free (&(*meta_data)->strip_chunks);
{
char buf[2048];
MEUserData *meudata = (MEUserData *) user_data;
- GType type;
+ GType type = G_TYPE_NONE;
ExifByteOrder byte_order;
const gchar *tag = metadataparse_exif_get_tag_from_exif (entry->tag, &type);
entry->components = strlen (value) + 1;
entry->size =
exif_format_get_size (entry->format) * entry->components;
- entry->data = value;
+ entry->data = (guint8 *) value;
}
}
break;
ExifShort v_short;
if (G_TYPE_UINT == type) {
- gst_tag_list_get_uint (list, tag, &value);
+ gst_tag_list_get_uint (list, tag, (guint *) & value);
} else {
gst_tag_list_get_int (list, tag, &value);
}
iptc_dataset_set_tag (dataset, record, iptc_tag);
if (gst_tag_list_get_string (list, tag, &tag_value)) {
- iptc_dataset_set_data (dataset, tag_value, strlen (tag_value),
+ iptc_dataset_set_data (dataset, (guint8 *) tag_value, strlen (tag_value),
IPTC_DONT_VALIDATE);
g_free (tag_value);
tag_value = NULL;
static const char XmpHeader[] = "http://ns.adobe.com/xap/1.0/";
metadatamux_wrap_chunk (&jpeg_data->inject_chunks->chunk[i],
- XmpHeader, sizeof (XmpHeader), 0xFF, 0xE1);
+ (guint8 *) XmpHeader, sizeof (XmpHeader), 0xFF, 0xE1);
}
break;
default:
gboolean jfif_found = FALSE;
static const char JfifHeader[] = "JFIF";
- static const unsigned char ExifHeader[] =
- { 0x45, 0x78, 0x69, 0x66, 0x00, 0x00 };
- static const char XmpHeader[] = "http://ns.adobe.com/xap/1.0/";
*next_start = *buf;
guint32 * bufsize, const guint32 offset, const guint8 * step_buf,
guint8 ** next_start, guint32 * next_size);
-static void metadatamux_make_crc_table (guint32 crc_table[]);
-
static guint32 metadatamux_update_crc (guint32 crc, guint8 * buf, guint32 len);
static guint32 metadatamux_calc_crc (guint8 * buf, guint32 len);
guint32 chunk_size = 0;
MetadataChunk chunk;
- static const char XmpHeader[] = "XML:com.adobe.xmp";
-
*next_start = *buf;
if (*bufsize < 8) {
* @len: size in bytes of @buf
*
* Calculates the CRC of a data buffer for a seed @crc.
- * @see_also: #metadatamux_make_crc_table #metadatamux_calc_crc
+ * @see_also: #metadatamux_calc_crc
*
* Returns: the CRC of the bytes buf[0..len-1].
*/
#include <string.h>
#include "metadataparsejpeg.h"
+#include "metadataparseutil.h"
#ifdef HAVE_IPTC
#include <libiptcdata/iptc-jpeg.h>
} else if (mark[1] == 0xE1) { /* may be it is Exif or XMP */
if (chunk_size >= 8) { /* size2 'EXIF' 0x00 0x00 */
- guint8 ch;
-
if (*bufsize < 6) {
*next_size = (*buf - *next_start) + 6;
ret = META_PARSING_NEED_MORE_DATA;
*/
#include "metadataparsepng.h"
+#include "metadataparseutil.h"
#include <string.h>
metadataparse_util_jump_chunk (guint32 * read, guint8 ** buf,
guint32 * bufsize, guint8 ** next_start, guint32 * next_size);
+extern MetadataParsingReturn
+metadataparse_util_hold_chunk (guint32 * read, guint8 ** buf,
+ guint32 * bufsize, guint8 ** next_start,
+ guint32 * next_size, GstAdapter ** adapter);
+
+extern MetadataParsingReturn
+metadataparse_util_jump_chunk (guint32 * read, guint8 ** buf,
+ guint32 * bufsize, guint8 ** next_start, guint32 * next_size);
+
G_END_DECLS
#endif /* __GST_METADATAPARSE_UTIL_H__ */
buf = gst_adapter_peek (adapter, size);
- xmp = xmp_new (buf, size);
+ xmp = xmp_new ((gchar *) buf, size);
if (!xmp)
goto done;
if (val) {
xmp_chunk = gst_value_get_buffer (val);
if (xmp_chunk)
- xmp = xmp_new (GST_BUFFER_DATA (xmp_chunk), GST_BUFFER_SIZE (xmp_chunk));
+ xmp =
+ xmp_new ((gchar *) GST_BUFFER_DATA (xmp_chunk),
+ GST_BUFFER_SIZE (xmp_chunk));
}
if (NULL == xmp)
uint32_t options = 0;
+#ifdef XMP_1_99_5
+ if (xmp_get_property (xmp, smap->schema, stagmap->xmp_tag,
+ NULL, &options)) {
+#else
if (xmp_get_property_and_bits (xmp, smap->schema, stagmap->xmp_tag,
NULL, &options)) {
-
+#endif
if (XMP_IS_PROP_SIMPLE (options)) {
#ifdef XMP_1_99_5
xmp_set_property (xmp, smap->schema, stagmap->xmp_tag, value, 0);