chromium/chrome/services/media_gallery_util/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//media/media_options.gni")
import("//testing/libfuzzer/fuzzer_test.gni")

source_set("lib") {
  sources = [
    "ipc_data_source.cc",
    "ipc_data_source.h",
    "media_metadata_parser.cc",
    "media_metadata_parser.h",
    "media_parser.cc",
    "media_parser.h",
    "media_parser_factory.cc",
    "media_parser_factory.h",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  deps = [
    "//base",
    "//chrome/common",
    "//media",
    "//mojo/public/cpp/bindings",
    "//third_party/libyuv",
  ]

  public_deps = [ "//chrome/services/media_gallery_util/public/mojom" ]

  if (is_android) {
    sources += [
      "media_parser_android.cc",
      "media_parser_android.h",
      "video_thumbnail_parser.cc",
      "video_thumbnail_parser.h",
    ]
  }

  if (media_use_ffmpeg) {
    deps += [
      "//third_party/ffmpeg",
      "//third_party/ffmpeg:ffmpeg_features",
    ]
  }
}

if (is_android) {
  source_set("unit_tests") {
    testonly = true
    sources = [ "media_parser_android_unittest.cc" ]

    data = [
      "//media/test/data/bear-av1.mp4",
      "//media/test/data/bear-hevc-frag.mp4",
      "//media/test/data/bear-vp8-webvtt.webm",
      "//media/test/data/bear-vp8a.webm",
      "//media/test/data/bear-vp9.webm",
      "//media/test/data/bear.mp4",
      "//media/test/data/sfx.mp3",
    ]

    deps = [
      ":lib",
      "//base/test:test_support",
      "//media:test_support",
      "//testing/gtest",
    ]
  }
}

fuzzer_test("media_metadata_parser_fuzzer") {
  sources = [ "media_metadata_parser_fuzzer.cc" ]
  deps = [
    ":lib",
    "//base",
    "//content/test:test_support",
  ]
}