Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / media / cast / BUILD.gn
blob632b334e56e5bf7ddef7343aed022b02949e8a31
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//testing/test.gni")
7 component("cast") {
8   deps = [
9     ":sender",
10     ":receiver",
11   ]
14 # Common code shared by all cast components.
15 source_set("common") {
16   sources = [
17     "cast_config.cc",
18     "cast_config.h",
19     "cast_defines.h",
20     "cast_environment.cc",
21     "cast_environment.h",
22     "common/clock_drift_smoother.cc",
23     "common/clock_drift_smoother.h",
24     "common/transport_encryption_handler.cc",
25     "common/transport_encryption_handler.h",
26     "logging/encoding_event_subscriber.cc",
27     "logging/encoding_event_subscriber.h",
28     "logging/log_deserializer.cc",
29     "logging/log_deserializer.h",
30     "logging/log_serializer.cc",
31     "logging/log_serializer.h",
32     "logging/logging_defines.cc",
33     "logging/logging_defines.h",
34     "logging/logging_impl.cc",
35     "logging/logging_impl.h",
36     "logging/logging_raw.cc",
37     "logging/logging_raw.h",
38     "logging/raw_event_subscriber.h",
39     "logging/raw_event_subscriber_bundle.cc",
40     "logging/raw_event_subscriber_bundle.h",
41     "logging/receiver_time_offset_estimator.h",
42     "logging/receiver_time_offset_estimator_impl.cc",
43     "logging/receiver_time_offset_estimator_impl.h",
44     "logging/simple_event_subscriber.cc",
45     "logging/simple_event_subscriber.h",
46     "logging/stats_event_subscriber.cc",
47     "logging/stats_event_subscriber.h",
48   ]
50   public_deps = [
51     "//media/cast/logging/proto",
52   ]
53   deps = [
54     "//base",
55     "//crypto",
56     "//net",
57     "//third_party/zlib",
58   ]
61 source_set("net") {
62   sources = [
63     "net/cast_transport_config.cc",
64     "net/cast_transport_config.h",
65     "net/cast_transport_defines.h",
66     "net/cast_transport_sender.h",
67     "net/cast_transport_sender_impl.cc",
68     "net/cast_transport_sender_impl.h",
69     "net/pacing/paced_sender.cc",
70     "net/pacing/paced_sender.h",
71     "net/rtcp/receiver_rtcp_event_subscriber.cc",
72     "net/rtcp/rtcp_defines.cc",
73     "net/rtcp/rtcp_defines.h",
74     "net/rtcp/rtcp.h",
75     "net/rtcp/rtcp.cc",
76     "net/rtcp/rtcp_builder.cc",
77     "net/rtcp/rtcp_builder.h",
78     "net/rtcp/rtcp_utility.cc",
79     "net/rtcp/rtcp_utility.h",
80     "net/rtp/packet_storage.cc",
81     "net/rtp/packet_storage.h",
82     "net/rtp/rtp_packetizer.cc",
83     "net/rtp/rtp_packetizer.h",
84     "net/rtp/rtp_sender.cc",
85     "net/rtp/rtp_sender.h",
86     "net/udp_transport.cc",
87     "net/udp_transport.h",
88     "net/rtp/cast_message_builder.cc",
89     "net/rtp/cast_message_builder.h",
90     "net/rtp/frame_buffer.cc",
91     "net/rtp/frame_buffer.h",
92     "net/rtp/framer.cc",
93     "net/rtp/framer.h",
94     "net/rtp/receiver_stats.cc",
95     "net/rtp/receiver_stats.h",
96     "net/rtp/rtp_parser.cc",
97     "net/rtp/rtp_parser.h",
98     "net/rtp/rtp_receiver_defines.cc",
99     "net/rtp/rtp_receiver_defines.h",
100   ]
102   deps = [
103     ":common",
104   ]
107 source_set("sender") {
108   sources = [
109     "cast_sender.h",
110     "cast_sender_impl.cc",
111     "cast_sender_impl.h",
112     "sender/audio_encoder.h",
113     "sender/audio_encoder.cc",
114     "sender/audio_sender.h",
115     "sender/audio_sender.cc",
116     "sender/congestion_control.h",
117     "sender/congestion_control.cc",
118     "sender/external_video_encoder.h",
119     "sender/external_video_encoder.cc",
120     "sender/fake_software_video_encoder.h",
121     "sender/fake_software_video_encoder.cc",
122     "sender/frame_sender.cc",
123     "sender/frame_sender.h",
124     "sender/software_video_encoder.h",
125     "sender/video_encoder.h",
126     "sender/video_encoder.cc",
127     "sender/video_encoder_impl.h",
128     "sender/video_encoder_impl.cc",
129     "sender/video_frame_factory.h",
130     "sender/video_sender.h",
131     "sender/video_sender.cc",
132     "sender/vp8_encoder.cc",
133     "sender/vp8_encoder.h",
134   ]
136   deps = [
137     ":common",
138     ":net",
139     "//media",
140     "//media:shared_memory_support",
141     "//third_party/libvpx",
142     "//third_party/opus",
143   ]
145   # use a restricted subset of media and no software codecs on iOS
146   if (is_ios) {
147     deps += [ "//media:media_for_cast_ios" ]
148     deps -= [
149       "//media",
150       "//third_party/libvpx",
151       "//third_party/opus",
152     ]
153     sources -= [
154       "sender/external_video_encoder.h",
155       "sender/external_video_encoder.cc",
156       "sender/video_encoder_impl.h",
157       "sender/video_encoder_impl.cc",
158       "sender/vp8_encoder.cc",
159       "sender/vp8_encoder.h",
160     ]
161   }
163   # iOS and OS X encoders
164   if (is_ios || is_mac) {
165     sources += [
166       "sender/h264_vt_encoder.cc",
167       "sender/h264_vt_encoder.h",
168     ]
169   }
172 source_set("receiver") {
173   sources = [
174     "cast_receiver.h",
175     "receiver/audio_decoder.cc",
176     "receiver/audio_decoder.h",
177     "receiver/cast_receiver_impl.cc",
178     "receiver/cast_receiver_impl.h",
179     "receiver/frame_receiver.cc",
180     "receiver/frame_receiver.h",
181     "receiver/video_decoder.cc",
182     "receiver/video_decoder.h",
183   ]
185   deps = [
186     ":common",
187     ":net",
188     "//media",
189     "//media:shared_memory_support",
190     "//third_party/libvpx",
191     "//third_party/opus",
192     "//ui/gfx",
193   ]
195   # use a restricted subset of media and no software codecs on iOS
196   if (is_ios) {
197     deps += [ "//media:media_for_cast_ios" ]
198     deps -= [
199       "//media",
200       "//third_party/libvpx",
201       "//third_party/opus",
202     ]
203   }
206 static_library("test_support") {
207   testonly = true
208   sources = [
209     # TODO(hclam): FFmpeg.
210     #    "test/fake_media_source.cc",
211     #    "test/fake_media_source.h",
212     "test/fake_single_thread_task_runner.cc",
213     "test/fake_single_thread_task_runner.h",
214     "test/skewed_single_thread_task_runner.cc",
215     "test/skewed_single_thread_task_runner.h",
216     "test/skewed_tick_clock.cc",
217     "test/skewed_tick_clock.h",
218     "test/loopback_transport.cc",
219     "test/loopback_transport.h",
220     "test/utility/audio_utility.cc",
221     "test/utility/audio_utility.h",
222     "test/utility/barcode.cc",
223     "test/utility/barcode.h",
224     "test/utility/default_config.cc",
225     "test/utility/default_config.h",
226     "test/utility/in_process_receiver.cc",
227     "test/utility/in_process_receiver.h",
228     "test/utility/input_builder.cc",
229     "test/utility/input_builder.h",
230     "test/utility/net_utility.cc",
231     "test/utility/net_utility.h",
232     "test/utility/standalone_cast_environment.cc",
233     "test/utility/standalone_cast_environment.h",
234     "test/utility/video_utility.cc",
235     "test/utility/video_utility.h",
236     "test/utility/udp_proxy.cc",
237     "test/utility/udp_proxy.h",
238   ]
240   deps = [
241     ":net",
242     ":receiver",
243     "//base/test:test_support",
244     "//testing/gtest",
246     # TODO(hclam): Does not build on ARM yet.
247     #    "//third_party/ffmpeg",
248     "//third_party/libyuv",
249     "//third_party/mt19937ar",
250     "//ui/gfx",
251     "//ui/gfx/geometry",
252   ]
255 test("cast_unittests") {
256   sources = [
257     "logging/encoding_event_subscriber_unittest.cc",
258     "logging/serialize_deserialize_test.cc",
259     "logging/logging_impl_unittest.cc",
260     "logging/logging_raw_unittest.cc",
261     "logging/receiver_time_offset_estimator_impl_unittest.cc",
262     "logging/simple_event_subscriber_unittest.cc",
263     "logging/stats_event_subscriber_unittest.cc",
264     "net/cast_transport_sender_impl_unittest.cc",
265     "net/mock_cast_transport_sender.cc",
266     "net/mock_cast_transport_sender.h",
267     "net/pacing/mock_paced_packet_sender.cc",
268     "net/pacing/mock_paced_packet_sender.h",
269     "net/pacing/paced_sender_unittest.cc",
270     "net/rtcp/rtcp_builder_unittest.cc",
271     "net/rtcp/rtcp_unittest.cc",
272     "net/rtcp/rtcp_utility_unittest.cc",
273     "net/rtcp/receiver_rtcp_event_subscriber_unittest.cc",
275     # TODO(miu): The following two are test utility modules.  Rename/move the files.
276     "net/rtcp/test_rtcp_packet_builder.cc",
277     "net/rtcp/test_rtcp_packet_builder.h",
278     "net/rtp/cast_message_builder_unittest.cc",
279     "net/rtp/frame_buffer_unittest.cc",
280     "net/rtp/framer_unittest.cc",
281     "net/rtp/mock_rtp_payload_feedback.cc",
282     "net/rtp/mock_rtp_payload_feedback.h",
283     "net/rtp/packet_storage_unittest.cc",
284     "net/rtp/receiver_stats_unittest.cc",
285     "net/rtp/rtp_header_parser.cc",
286     "net/rtp/rtp_header_parser.h",
287     "net/rtp/rtp_packet_builder.cc",
288     "net/rtp/rtp_parser_unittest.cc",
289     "net/rtp/rtp_packetizer_unittest.cc",
290     "net/rtp/rtp_receiver_defines.h",
291     "net/udp_transport_unittest.cc",
292     "receiver/audio_decoder_unittest.cc",
293     "receiver/frame_receiver_unittest.cc",
294     "receiver/video_decoder_unittest.cc",
295     "sender/audio_encoder_unittest.cc",
296     "sender/audio_sender_unittest.cc",
297     "sender/congestion_control_unittest.cc",
298     "sender/external_video_encoder_unittest.cc",
299     "sender/video_encoder_impl_unittest.cc",
300     "sender/video_sender_unittest.cc",
301     "test/end2end_unittest.cc",
302     "test/fake_receiver_time_offset_estimator.cc",
303     "test/fake_receiver_time_offset_estimator.h",
304     "test/fake_video_encode_accelerator.cc",
305     "test/fake_video_encode_accelerator.h",
306     "test/utility/audio_utility_unittest.cc",
307     "test/utility/barcode_unittest.cc",
308   ]
310   deps = [
311     ":common",
312     ":receiver",
313     ":sender",
314     ":test_support",
315     "//base/test:run_all_unittests",
316     "//base/test:test_support",
317     "//testing/gmock",
318     "//testing/gtest",
319   ]
322 if (is_ios || is_mac) {
323   test("cast_h264_vt_encoder_unittests") {
324     sources = [
325       "sender/h264_vt_encoder_unittest.cc",
326     ]
327     deps = [
328       ":common",
329       ":sender",
330       ":test_support",
331       "//base/test:test_support",
332       "//testing/gmock",
333       "//testing/gtest",
334       "//third_party/ffmpeg",
335     ]
336   }
339 executable("generate_barcode_video") {
340   testonly = true
341   sources = [
342     "test/utility/generate_barcode_video.cc",
343   ]
345   deps = [
346     ":test_support",
347     "//base",
348     "//media",
349   ]
352 executable("generate_timecode_audio") {
353   testonly = true
354   sources = [
355     "test/utility/generate_timecode_audio.cc",
356   ]
358   deps = [
359     ":test_support",
360     "//base",
361     "//media",
362   ]
365 executable("udp_proxy") {
366   testonly = true
367   sources = [
368     "test/utility/udp_proxy_main.cc",
369   ]
371   deps = [
372     ":test_support",
373     "//base",
374     "//net",
375   ]