aboutsummaryrefslogtreecommitdiff
path: root/common_video/BUILD.gn
blob: 5bc4eb4ad38dd3a8032876069b208f6708584606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("../webrtc.gni")

rtc_static_library("common_video") {
  visibility = [ "*" ]

  sources = [
    "bitrate_adjuster.cc",
    "h264/h264_bitstream_parser.cc",
    "h264/h264_bitstream_parser.h",
    "h264/h264_common.cc",
    "h264/h264_common.h",
    "h264/pps_parser.cc",
    "h264/pps_parser.h",
    "h264/profile_level_id.h",
    "h264/sps_parser.cc",
    "h264/sps_parser.h",
    "h264/sps_vui_rewriter.cc",
    "h264/sps_vui_rewriter.h",
    "i420_buffer_pool.cc",
    "include/bitrate_adjuster.h",
    "include/frame_callback.h",
    "include/i420_buffer_pool.h",
    "include/incoming_video_stream.h",
    "include/video_bitrate_allocator.h",
    "include/video_frame.h",
    "include/video_frame_buffer.h",
    "incoming_video_stream.cc",
    "libyuv/include/webrtc_libyuv.h",
    "libyuv/webrtc_libyuv.cc",
    "video_frame.cc",
    "video_frame_buffer.cc",
    "video_render_frames.cc",
    "video_render_frames.h",
  ]

  deps = [
    "..:webrtc_common",
    "../api/video:video_bitrate_allocation",
    "../api/video:video_bitrate_allocator",
    "../api/video:video_frame",
    "../api/video:video_frame_i420",
    "../media:rtc_h264_profile_id",
    "../modules:module_api",
    "../rtc_base:checks",
    "../rtc_base:rtc_base",
    "../rtc_base:rtc_task_queue",
    "../rtc_base:safe_minmax",
    "//third_party/abseil-cpp/absl/types:optional",
    "//third_party/libyuv",
  ]
}

if (rtc_include_tests) {
  common_video_resources = [ "../resources/foreman_cif.yuv" ]

  if (is_ios) {
    bundle_data("common_video_unittests_bundle_data") {
      testonly = true
      sources = common_video_resources
      outputs = [
        "{{bundle_resources_dir}}/{{source_file_part}}",
      ]
    }
  }

  rtc_test("common_video_unittests") {
    testonly = true

    sources = [
      "bitrate_adjuster_unittest.cc",
      "h264/h264_bitstream_parser_unittest.cc",
      "h264/pps_parser_unittest.cc",
      "h264/profile_level_id_unittest.cc",
      "h264/sps_parser_unittest.cc",
      "h264/sps_vui_rewriter_unittest.cc",
      "i420_buffer_pool_unittest.cc",
      "libyuv/libyuv_unittest.cc",
      "video_frame_unittest.cc",
    ]

    deps = [
      ":common_video",
      "../api/video:video_frame",
      "../api/video:video_frame_i010",
      "../api/video:video_frame_i420",
      "../modules/video_capture:video_capture",
      "../rtc_base:rtc_base",
      "../rtc_base:rtc_base_approved",
      "../rtc_base:rtc_base_tests_utils",
      "../test:fileutils",
      "../test:test_main",
      "../test:video_test_common",
      "//testing/gtest",
      "//third_party/libyuv",
    ]

    data = common_video_resources
    if (is_android) {
      deps += [ "//testing/android/native_test:native_test_support" ]
      shard_timeout = 900
    }

    if (is_ios) {
      deps += [ ":common_video_unittests_bundle_data" ]
    }
  }
}