Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / media / cast / BUILD.gn
blobb6df09f4e874838ae7bbf76433b65d26749229be
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.cc",
73     "net/rtcp/rtcp.h",
74     "net/rtcp/rtcp_builder.cc",
75     "net/rtcp/rtcp_builder.h",
76     "net/rtcp/rtcp_defines.cc",
77     "net/rtcp/rtcp_defines.h",
78     "net/rtcp/rtcp_utility.cc",
79     "net/rtcp/rtcp_utility.h",
80     "net/rtp/cast_message_builder.cc",
81     "net/rtp/cast_message_builder.h",
82     "net/rtp/frame_buffer.cc",
83     "net/rtp/frame_buffer.h",
84     "net/rtp/framer.cc",
85     "net/rtp/framer.h",
86     "net/rtp/packet_storage.cc",
87     "net/rtp/packet_storage.h",
88     "net/rtp/receiver_stats.cc",
89     "net/rtp/receiver_stats.h",
90     "net/rtp/rtp_packetizer.cc",
91     "net/rtp/rtp_packetizer.h",
92     "net/rtp/rtp_parser.cc",
93     "net/rtp/rtp_parser.h",
94     "net/rtp/rtp_receiver_defines.cc",
95     "net/rtp/rtp_receiver_defines.h",
96     "net/rtp/rtp_sender.cc",
97     "net/rtp/rtp_sender.h",
98     "net/udp_transport.cc",
99     "net/udp_transport.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.cc",
113     "sender/audio_encoder.h",
114     "sender/audio_sender.cc",
115     "sender/audio_sender.h",
116     "sender/congestion_control.cc",
117     "sender/congestion_control.h",
118     "sender/external_video_encoder.cc",
119     "sender/external_video_encoder.h",
120     "sender/fake_software_video_encoder.cc",
121     "sender/fake_software_video_encoder.h",
122     "sender/frame_sender.cc",
123     "sender/frame_sender.h",
124     "sender/size_adaptable_video_encoder_base.cc",
125     "sender/size_adaptable_video_encoder_base.h",
126     "sender/software_video_encoder.h",
127     "sender/video_encoder.cc",
128     "sender/video_encoder.h",
129     "sender/video_encoder_impl.cc",
130     "sender/video_encoder_impl.h",
131     "sender/video_frame_factory.h",
132     "sender/video_sender.cc",
133     "sender/video_sender.h",
134     "sender/vp8_encoder.cc",
135     "sender/vp8_encoder.h",
136   ]
138   deps = [
139     ":common",
140     ":net",
141     "//media",
142     "//media:shared_memory_support",
143     "//third_party/libvpx",
144     "//third_party/opus",
145     "//ui/gfx/geometry",
146   ]
148   # use a restricted subset of media and no software codecs on iOS
149   if (is_ios) {
150     deps += [ "//media:media_for_cast_ios" ]
151     deps -= [
152       "//media",
153       "//third_party/libvpx",
154       "//third_party/opus",
155     ]
156     sources -= [
157       "sender/external_video_encoder.cc",
158       "sender/external_video_encoder.h",
159       "sender/video_encoder_impl.cc",
160       "sender/video_encoder_impl.h",
161       "sender/vp8_encoder.cc",
162       "sender/vp8_encoder.h",
163     ]
164   }
166   libs = []
168   # iOS and OS X encoders
169   if (is_ios || is_mac) {
170     sources += [
171       "sender/h264_vt_encoder.cc",
172       "sender/h264_vt_encoder.h",
173     ]
175     libs += [
176       "CoreVideo.framework",
177     ]
178   }
180   if (is_mac) {
181     # Required by audio_encoder.cc.
182     libs += [
183       "AudioToolbox.framework",
184     ]
185   }
188 source_set("receiver") {
189   sources = [
190     "cast_receiver.h",
191     "receiver/audio_decoder.cc",
192     "receiver/audio_decoder.h",
193     "receiver/cast_receiver_impl.cc",
194     "receiver/cast_receiver_impl.h",
195     "receiver/frame_receiver.cc",
196     "receiver/frame_receiver.h",
197     "receiver/video_decoder.cc",
198     "receiver/video_decoder.h",
199   ]
201   deps = [
202     ":common",
203     ":net",
204     "//media",
205     "//media:shared_memory_support",
206     "//third_party/libvpx",
207     "//third_party/opus",
208     "//ui/gfx",
209   ]
211   # use a restricted subset of media and no software codecs on iOS
212   if (is_ios) {
213     deps += [ "//media:media_for_cast_ios" ]
214     deps -= [
215       "//media",
216       "//third_party/libvpx",
217       "//third_party/opus",
218     ]
219   }
222 static_library("test_support") {
223   testonly = true
224   sources = [
225     # TODO(hclam): FFmpeg.
226     #    "test/fake_media_source.cc",
227     #    "test/fake_media_source.h",
228     "test/fake_single_thread_task_runner.cc",
229     "test/fake_single_thread_task_runner.h",
230     "test/loopback_transport.cc",
231     "test/loopback_transport.h",
232     "test/skewed_single_thread_task_runner.cc",
233     "test/skewed_single_thread_task_runner.h",
234     "test/skewed_tick_clock.cc",
235     "test/skewed_tick_clock.h",
236     "test/utility/audio_utility.cc",
237     "test/utility/audio_utility.h",
238     "test/utility/barcode.cc",
239     "test/utility/barcode.h",
240     "test/utility/default_config.cc",
241     "test/utility/default_config.h",
242     "test/utility/in_process_receiver.cc",
243     "test/utility/in_process_receiver.h",
244     "test/utility/input_builder.cc",
245     "test/utility/input_builder.h",
246     "test/utility/net_utility.cc",
247     "test/utility/net_utility.h",
248     "test/utility/standalone_cast_environment.cc",
249     "test/utility/standalone_cast_environment.h",
250     "test/utility/udp_proxy.cc",
251     "test/utility/udp_proxy.h",
252     "test/utility/video_utility.cc",
253     "test/utility/video_utility.h",
254   ]
256   deps = [
257     ":net",
258     ":receiver",
259     "//base/test:test_support",
260     "//testing/gtest",
262     # TODO(hclam): Does not build on ARM yet.
263     #    "//third_party/ffmpeg",
264     "//third_party/libyuv",
265     "//third_party/mt19937ar",
266     "//ui/gfx",
267     "//ui/gfx/geometry",
268   ]
271 test("cast_unittests") {
272   sources = [
273     "logging/encoding_event_subscriber_unittest.cc",
274     "logging/logging_impl_unittest.cc",
275     "logging/logging_raw_unittest.cc",
276     "logging/receiver_time_offset_estimator_impl_unittest.cc",
277     "logging/serialize_deserialize_test.cc",
278     "logging/simple_event_subscriber_unittest.cc",
279     "logging/stats_event_subscriber_unittest.cc",
280     "net/cast_transport_sender_impl_unittest.cc",
281     "net/mock_cast_transport_sender.cc",
282     "net/mock_cast_transport_sender.h",
283     "net/pacing/mock_paced_packet_sender.cc",
284     "net/pacing/mock_paced_packet_sender.h",
285     "net/pacing/paced_sender_unittest.cc",
286     "net/rtcp/receiver_rtcp_event_subscriber_unittest.cc",
287     "net/rtcp/rtcp_builder_unittest.cc",
288     "net/rtcp/rtcp_unittest.cc",
289     "net/rtcp/rtcp_utility_unittest.cc",
291     # TODO(miu): The following two are test utility modules.  Rename/move the files.
292     "net/rtcp/test_rtcp_packet_builder.cc",
293     "net/rtcp/test_rtcp_packet_builder.h",
294     "net/rtp/cast_message_builder_unittest.cc",
295     "net/rtp/frame_buffer_unittest.cc",
296     "net/rtp/framer_unittest.cc",
297     "net/rtp/mock_rtp_payload_feedback.cc",
298     "net/rtp/mock_rtp_payload_feedback.h",
299     "net/rtp/packet_storage_unittest.cc",
300     "net/rtp/receiver_stats_unittest.cc",
301     "net/rtp/rtp_header_parser.cc",
302     "net/rtp/rtp_header_parser.h",
303     "net/rtp/rtp_packet_builder.cc",
304     "net/rtp/rtp_packetizer_unittest.cc",
305     "net/rtp/rtp_parser_unittest.cc",
306     "net/rtp/rtp_receiver_defines.h",
307     "net/udp_transport_unittest.cc",
308     "receiver/audio_decoder_unittest.cc",
309     "receiver/frame_receiver_unittest.cc",
310     "receiver/video_decoder_unittest.cc",
311     "sender/audio_encoder_unittest.cc",
312     "sender/audio_sender_unittest.cc",
313     "sender/congestion_control_unittest.cc",
314     "sender/fake_video_encode_accelerator_factory.cc",
315     "sender/fake_video_encode_accelerator_factory.h",
316     "sender/video_encoder_unittest.cc",
317     "sender/video_sender_unittest.cc",
318     "test/end2end_unittest.cc",
319     "test/fake_receiver_time_offset_estimator.cc",
320     "test/fake_receiver_time_offset_estimator.h",
321     "test/utility/audio_utility_unittest.cc",
322     "test/utility/barcode_unittest.cc",
323   ]
325   deps = [
326     ":common",
327     ":receiver",
328     ":sender",
329     ":test_support",
330     "//base/test:run_all_unittests",
331     "//base/test:test_support",
332     "//testing/gmock",
333     "//testing/gtest",
334   ]
337 if (is_ios || is_mac) {
338   test("cast_h264_vt_encoder_unittests") {
339     sources = [
340       "sender/h264_vt_encoder_unittest.cc",
341     ]
342     deps = [
343       ":common",
344       ":sender",
345       ":test_support",
346       "//base/test:test_support",
347       "//testing/gmock",
348       "//testing/gtest",
349       "//third_party/ffmpeg",
350     ]
351   }
354 executable("generate_barcode_video") {
355   testonly = true
356   sources = [
357     "test/utility/generate_barcode_video.cc",
358   ]
360   deps = [
361     ":test_support",
362     "//base",
363     "//media",
364   ]
367 executable("generate_timecode_audio") {
368   testonly = true
369   sources = [
370     "test/utility/generate_timecode_audio.cc",
371   ]
373   deps = [
374     ":test_support",
375     "//base",
376     "//media",
377   ]
380 executable("udp_proxy") {
381   testonly = true
382   sources = [
383     "test/utility/udp_proxy_main.cc",
384   ]
386   deps = [
387     ":test_support",
388     "//base",
389     "//net",
390   ]
393 if (is_linux && !is_chromeos) {
394   # TODO(GYP): Figure out which of these work and are needed on other platforms.
395   test("cast_benchmarks") {
396     sources = [
397       "test/cast_benchmarks.cc",
398       "test/fake_single_thread_task_runner.cc",
399       "test/fake_single_thread_task_runner.h",
400       "test/utility/test_util.cc",
401       "test/utility/test_util.h",
402     ]
404     deps = [
405       ":common",
406       ":net",
407       ":receiver",
408       ":sender",
409       ":test_support",
410       "//base/test:test_support",
411       "//net",
412       "//testing/gtest",
413     ]
414   }
416   test("tap_proxy") {
417     sources = [
418       "test/utility/tap_proxy.cc",
419     ]
421     deps = [
422       ":test_support",
423       "//base",
424       "//media",
425     ]
426   }