Revert "Omit calls to set composing region when pasting image."
[chromium-blink-merge.git] / media / cast / BUILD.gn
blob61452ea10b1664782ed969797fe23503a9442092
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/performance_metrics_overlay.cc",
125     "sender/performance_metrics_overlay.h",
126     "sender/sender_encoded_frame.cc",
127     "sender/sender_encoded_frame.h",
128     "sender/size_adaptable_video_encoder_base.cc",
129     "sender/size_adaptable_video_encoder_base.h",
130     "sender/software_video_encoder.h",
131     "sender/video_encoder.cc",
132     "sender/video_encoder.h",
133     "sender/video_encoder_impl.cc",
134     "sender/video_encoder_impl.h",
135     "sender/video_frame_factory.h",
136     "sender/video_sender.cc",
137     "sender/video_sender.h",
138     "sender/vp8_encoder.cc",
139     "sender/vp8_encoder.h",
140   ]
142   deps = [
143     ":common",
144     ":net",
145     "//media",
146     "//media:shared_memory_support",
147     "//third_party/libvpx_new",
148     "//third_party/opus",
149     "//ui/gfx/geometry",
150   ]
152   # use a restricted subset of media and no software codecs on iOS
153   if (is_ios) {
154     deps += [ "//media:media_for_cast_ios" ]
155     deps -= [
156       "//media",
157       "//third_party/libvpx_new",
158       "//third_party/opus",
159     ]
160     sources -= [
161       "sender/external_video_encoder.cc",
162       "sender/external_video_encoder.h",
163       "sender/video_encoder_impl.cc",
164       "sender/video_encoder_impl.h",
165       "sender/vp8_encoder.cc",
166       "sender/vp8_encoder.h",
167     ]
168   }
170   libs = []
172   # iOS and OS X encoders
173   if (is_ios || is_mac) {
174     sources += [
175       "sender/h264_vt_encoder.cc",
176       "sender/h264_vt_encoder.h",
177     ]
179     libs += [
180       "AudioToolbox.framework",
181       "CoreVideo.framework",
182     ]
183   }
186 source_set("receiver") {
187   sources = [
188     "cast_receiver.h",
189     "receiver/audio_decoder.cc",
190     "receiver/audio_decoder.h",
191     "receiver/cast_receiver_impl.cc",
192     "receiver/cast_receiver_impl.h",
193     "receiver/frame_receiver.cc",
194     "receiver/frame_receiver.h",
195     "receiver/video_decoder.cc",
196     "receiver/video_decoder.h",
197   ]
199   deps = [
200     ":common",
201     ":net",
202     "//media",
203     "//media:shared_memory_support",
204     "//third_party/libvpx_new",
205     "//third_party/opus",
206     "//ui/gfx",
207   ]
209   # use a restricted subset of media and no software codecs on iOS
210   if (is_ios) {
211     deps += [ "//media:media_for_cast_ios" ]
212     deps -= [
213       "//media",
214       "//third_party/libvpx_new",
215       "//third_party/opus",
216     ]
217   }
220 static_library("test_support") {
221   testonly = true
222   sources = [
223     # TODO(hclam): FFmpeg.
224     #    "test/fake_media_source.cc",
225     #    "test/fake_media_source.h",
226     "test/fake_single_thread_task_runner.cc",
227     "test/fake_single_thread_task_runner.h",
228     "test/loopback_transport.cc",
229     "test/loopback_transport.h",
230     "test/skewed_single_thread_task_runner.cc",
231     "test/skewed_single_thread_task_runner.h",
232     "test/skewed_tick_clock.cc",
233     "test/skewed_tick_clock.h",
234     "test/utility/audio_utility.cc",
235     "test/utility/audio_utility.h",
236     "test/utility/barcode.cc",
237     "test/utility/barcode.h",
238     "test/utility/default_config.cc",
239     "test/utility/default_config.h",
240     "test/utility/in_process_receiver.cc",
241     "test/utility/in_process_receiver.h",
242     "test/utility/input_builder.cc",
243     "test/utility/input_builder.h",
244     "test/utility/net_utility.cc",
245     "test/utility/net_utility.h",
246     "test/utility/standalone_cast_environment.cc",
247     "test/utility/standalone_cast_environment.h",
248     "test/utility/udp_proxy.cc",
249     "test/utility/udp_proxy.h",
250     "test/utility/video_utility.cc",
251     "test/utility/video_utility.h",
252   ]
254   deps = [
255     ":net",
256     ":receiver",
257     "//base/test:test_support",
258     "//testing/gtest",
260     # TODO(hclam): Does not build on ARM yet.
261     #    "//third_party/ffmpeg",
262     "//third_party/libyuv",
263     "//third_party/mt19937ar",
264     "//ui/gfx",
265     "//ui/gfx/geometry",
266   ]
269 # TODO(GYP): Delete this after we've converted everything to GN.
270 # The _run targets exist only for compatibility w/ GYP.
271 group("cast_unittests_run") {
272   testonly = true
273   deps = [
274     ":cast_unittests",
275   ]
278 test("cast_unittests") {
279   sources = [
280     "logging/encoding_event_subscriber_unittest.cc",
281     "logging/logging_impl_unittest.cc",
282     "logging/logging_raw_unittest.cc",
283     "logging/receiver_time_offset_estimator_impl_unittest.cc",
284     "logging/serialize_deserialize_test.cc",
285     "logging/simple_event_subscriber_unittest.cc",
286     "logging/stats_event_subscriber_unittest.cc",
287     "net/cast_transport_sender_impl_unittest.cc",
288     "net/frame_id_wrap_helper_test.cc",
289     "net/mock_cast_transport_sender.cc",
290     "net/mock_cast_transport_sender.h",
291     "net/pacing/mock_paced_packet_sender.cc",
292     "net/pacing/mock_paced_packet_sender.h",
293     "net/pacing/paced_sender_unittest.cc",
294     "net/rtcp/receiver_rtcp_event_subscriber_unittest.cc",
295     "net/rtcp/rtcp_builder_unittest.cc",
296     "net/rtcp/rtcp_unittest.cc",
297     "net/rtcp/rtcp_utility_unittest.cc",
299     # TODO(miu): The following two are test utility modules.  Rename/move the files.
300     "net/rtcp/test_rtcp_packet_builder.cc",
301     "net/rtcp/test_rtcp_packet_builder.h",
302     "net/rtp/cast_message_builder_unittest.cc",
303     "net/rtp/frame_buffer_unittest.cc",
304     "net/rtp/framer_unittest.cc",
305     "net/rtp/mock_rtp_payload_feedback.cc",
306     "net/rtp/mock_rtp_payload_feedback.h",
307     "net/rtp/packet_storage_unittest.cc",
308     "net/rtp/receiver_stats_unittest.cc",
309     "net/rtp/rtp_header_parser.cc",
310     "net/rtp/rtp_header_parser.h",
311     "net/rtp/rtp_packet_builder.cc",
312     "net/rtp/rtp_packetizer_unittest.cc",
313     "net/rtp/rtp_parser_unittest.cc",
314     "net/rtp/rtp_receiver_defines.h",
315     "net/udp_transport_unittest.cc",
316     "receiver/audio_decoder_unittest.cc",
317     "receiver/frame_receiver_unittest.cc",
318     "receiver/video_decoder_unittest.cc",
319     "sender/audio_encoder_unittest.cc",
320     "sender/audio_sender_unittest.cc",
321     "sender/congestion_control_unittest.cc",
322     "sender/external_video_encoder_unittest.cc",
323     "sender/fake_video_encode_accelerator_factory.cc",
324     "sender/fake_video_encode_accelerator_factory.h",
325     "sender/video_encoder_unittest.cc",
326     "sender/video_sender_unittest.cc",
327     "test/end2end_unittest.cc",
328     "test/fake_receiver_time_offset_estimator.cc",
329     "test/fake_receiver_time_offset_estimator.h",
330     "test/utility/audio_utility_unittest.cc",
331     "test/utility/barcode_unittest.cc",
332   ]
334   deps = [
335     ":common",
336     ":receiver",
337     ":sender",
338     ":test_support",
339     "//base/test:run_all_unittests",
340     "//base/test:test_support",
341     "//testing/gmock",
342     "//testing/gtest",
343   ]
346 if (is_ios || is_mac) {
347   test("cast_h264_vt_encoder_unittests") {
348     sources = [
349       "sender/h264_vt_encoder_unittest.cc",
350     ]
351     deps = [
352       ":common",
353       ":sender",
354       ":test_support",
355       "//base/test:test_support",
356       "//testing/gmock",
357       "//testing/gtest",
358       "//third_party/ffmpeg",
359     ]
360   }
363 executable("generate_barcode_video") {
364   testonly = true
365   sources = [
366     "test/utility/generate_barcode_video.cc",
367   ]
369   deps = [
370     ":test_support",
371     "//base",
372     "//build/config/sanitizers:deps",
373     "//media",
374   ]
377 executable("generate_timecode_audio") {
378   testonly = true
379   sources = [
380     "test/utility/generate_timecode_audio.cc",
381   ]
383   deps = [
384     ":test_support",
385     "//base",
386     "//build/config/sanitizers:deps",
387     "//media",
388   ]
391 executable("udp_proxy") {
392   testonly = true
393   sources = [
394     "test/utility/udp_proxy_main.cc",
395   ]
397   deps = [
398     ":test_support",
399     "//base",
400     "//build/config/sanitizers:deps",
401     "//net",
402   ]
405 if (is_linux && !is_chromeos) {
406   # TODO(GYP): Figure out which of these work and are needed on other platforms.
407   test("cast_benchmarks") {
408     sources = [
409       "test/cast_benchmarks.cc",
410       "test/fake_single_thread_task_runner.cc",
411       "test/fake_single_thread_task_runner.h",
412       "test/utility/test_util.cc",
413       "test/utility/test_util.h",
414     ]
416     deps = [
417       ":common",
418       ":net",
419       ":receiver",
420       ":sender",
421       ":test_support",
422       "//base/test:test_support",
423       "//net",
424       "//testing/gtest",
425     ]
426   }
428   test("tap_proxy") {
429     sources = [
430       "test/utility/tap_proxy.cc",
431     ]
433     deps = [
434       ":test_support",
435       "//base",
436       "//media",
437     ]
438   }