Beispiel #1
0
static void
compare_flash (ExifEntry * entry, ExifTagCheckData * testdata)
{
  guint16 flags;
  gboolean flash_fired;
  const gchar *flash_mode;

  flags = (gint) exif_get_short (entry->data,
      exif_data_get_byte_order (entry->parent->parent));

  if (!gst_tag_list_get_boolean_index (testdata->taglist,
          GST_TAG_CAPTURING_FLASH_FIRED, 0, &flash_fired)) {
    GST_WARNING ("Failed to get %s tag", GST_TAG_CAPTURING_FLASH_FIRED);
    return;
  }
  if (!gst_tag_list_peek_string_index (testdata->taglist,
          GST_TAG_CAPTURING_FLASH_MODE, 0, &flash_mode)) {
    GST_WARNING ("Failed to get %s tag", GST_TAG_CAPTURING_FLASH_MODE);
    return;
  }

  if (flash_fired)
    fail_unless ((flags & 1) == 1);
  else
    fail_unless ((flags & 1) == 0);

  if (strcmp (flash_mode, "auto") == 0) {
    fail_unless (((flags >> 3) & 0x3) == 3);
  } else if (strcmp (flash_mode, "always") == 0) {
Beispiel #2
0
bool get_value(tag_list const &p_tag_list, std::string const &p_name, std::string &p_value, const guint p_index)
{
	g_assert(!p_name.empty());

	if (p_tag_list.is_empty())
		return false;

	gchar const *str;
	gboolean ret = gst_tag_list_peek_string_index(p_tag_list.get_tag_list(), p_name.c_str(), p_index, &str);
	if (!ret)
		return false;

	p_value = str;

	return true;
}