Revert of Set defaultPageScaleLimits before setIgnoreViewportTagScaleLimits (patchset...
[chromium-blink-merge.git] / media / cast / BUILD.gn
blob6a250d0d1bb1ae84878395f7744c90bc4500eb41
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     "//ui/gfx/geometry",
144   ]
146   # use a restricted subset of media and no software codecs on iOS
147   if (is_ios) {
148     deps += [ "//media:media_for_cast_ios" ]
149     deps -= [
150       "//media",
151       "//third_party/libvpx",
152       "//third_party/opus",
153     ]
154     sources -= [
155       "sender/external_video_encoder.h",
156       "sender/external_video_encoder.cc",
157       "sender/video_encoder_impl.h",
158       "sender/video_encoder_impl.cc",
159       "sender/vp8_encoder.cc",
160       "sender/vp8_encoder.h",
161     ]
162   }
164   # iOS and OS X encoders
165   if (is_ios || is_mac) {
166     sources += [
167       "sender/h264_vt_encoder.cc",
168       "sender/h264_vt_encoder.h",
169     ]
170   }
173 source_set("receiver") {
174   sources = [
175     "cast_receiver.h",
176     "receiver/audio_decoder.cc",
177     "receiver/audio_decoder.h",
178     "receiver/cast_receiver_impl.cc",
179     "receiver/cast_receiver_impl.h",
180     "receiver/frame_receiver.cc",
181     "receiver/frame_receiver.h",
182     "receiver/video_decoder.cc",
183     "receiver/video_decoder.h",
184   ]
186   deps = [
187     ":common",
188     ":net",
189     "//media",
190     "//media:shared_memory_support",
191     "//third_party/libvpx",
192     "//third_party/opus",
193     "//ui/gfx",
194   ]
196   # use a restricted subset of media and no software codecs on iOS
197   if (is_ios) {
198     deps += [ "//media:media_for_cast_ios" ]
199     deps -= [
200       "//media",
201       "//third_party/libvpx",
202       "//third_party/opus",
203     ]
204   }
207 static_library("test_support") {
208   testonly = true
209   sources = [
210     # TODO(hclam): FFmpeg.
211     #    "test/fake_media_source.cc",
212     #    "test/fake_media_source.h",
213     "test/fake_single_thread_task_runner.cc",
214     "test/fake_single_thread_task_runner.h",
215     "test/skewed_single_thread_task_runner.cc",
216     "test/skewed_single_thread_task_runner.h",
217     "test/skewed_tick_clock.cc",
218     "test/skewed_tick_clock.h",
219     "test/loopback_transport.cc",
220     "test/loopback_transport.h",
221     "test/utility/audio_utility.cc",
222     "test/utility/audio_utility.h",
223     "test/utility/barcode.cc",
224     "test/utility/barcode.h",
225     "test/utility/default_config.cc",
226     "test/utility/default_config.h",
227     "test/utility/in_process_receiver.cc",
228     "test/utility/in_process_receiver.h",
229     "test/utility/input_builder.cc",
230     "test/utility/input_builder.h",
231     "test/utility/net_utility.cc",
232     "test/utility/net_utility.h",
233     "test/utility/standalone_cast_environment.cc",
234     "test/utility/standalone_cast_environment.h",
235     "test/utility/video_utility.cc",
236     "test/utility/video_utility.h",
237     "test/utility/udp_proxy.cc",
238     "test/utility/udp_proxy.h",
239   ]
241   deps = [
242     ":net",
243     ":receiver",
244     "//base/test:test_support",
245     "//testing/gtest",
247     # TODO(hclam): Does not build on ARM yet.
248     #    "//third_party/ffmpeg",
249     "//third_party/libyuv",
250     "//third_party/mt19937ar",
251     "//ui/gfx",
252     "//ui/gfx/geometry",
253   ]
256 test("cast_unittests") {
257   sources = [
258     "logging/encoding_event_subscriber_unittest.cc",
259     "logging/serialize_deserialize_test.cc",
260     "logging/logging_impl_unittest.cc",
261     "logging/logging_raw_unittest.cc",
262     "logging/receiver_time_offset_estimator_impl_unittest.cc",
263     "logging/simple_event_subscriber_unittest.cc",
264     "logging/stats_event_subscriber_unittest.cc",
265     "net/cast_transport_sender_impl_unittest.cc",
266     "net/mock_cast_transport_sender.cc",
267     "net/mock_cast_transport_sender.h",
268     "net/pacing/mock_paced_packet_sender.cc",
269     "net/pacing/mock_paced_packet_sender.h",
270     "net/pacing/paced_sender_unittest.cc",
271     "net/rtcp/rtcp_builder_unittest.cc",
272     "net/rtcp/rtcp_unittest.cc",
273     "net/rtcp/rtcp_utility_unittest.cc",
274     "net/rtcp/receiver_rtcp_event_subscriber_unittest.cc",
276     # TODO(miu): The following two are test utility modules.  Rename/move the files.
277     "net/rtcp/test_rtcp_packet_builder.cc",
278     "net/rtcp/test_rtcp_packet_builder.h",
279     "net/rtp/cast_message_builder_unittest.cc",
280     "net/rtp/frame_buffer_unittest.cc",
281     "net/rtp/framer_unittest.cc",
282     "net/rtp/mock_rtp_payload_feedback.cc",
283     "net/rtp/mock_rtp_payload_feedback.h",
284     "net/rtp/packet_storage_unittest.cc",
285     "net/rtp/receiver_stats_unittest.cc",
286     "net/rtp/rtp_header_parser.cc",
287     "net/rtp/rtp_header_parser.h",
288     "net/rtp/rtp_packet_builder.cc",
289     "net/rtp/rtp_parser_unittest.cc",
290     "net/rtp/rtp_packetizer_unittest.cc",
291     "net/rtp/rtp_receiver_defines.h",
292     "net/udp_transport_unittest.cc",
293     "receiver/audio_decoder_unittest.cc",
294     "receiver/frame_receiver_unittest.cc",
295     "receiver/video_decoder_unittest.cc",
296     "sender/audio_encoder_unittest.cc",
297     "sender/audio_sender_unittest.cc",
298     "sender/congestion_control_unittest.cc",
299     "sender/external_video_encoder_unittest.cc",
300     "sender/fake_video_encode_accelerator_factory.cc",
301     "sender/fake_video_encode_accelerator_factory.h",
302     "sender/video_encoder_impl_unittest.cc",
303     "sender/video_sender_unittest.cc",
304     "test/end2end_unittest.cc",
305     "test/fake_receiver_time_offset_estimator.cc",
306     "test/fake_receiver_time_offset_estimator.h",
307     "test/utility/audio_utility_unittest.cc",
308     "test/utility/barcode_unittest.cc",
309   ]
311   deps = [
312     ":common",
313     ":receiver",
314     ":sender",
315     ":test_support",
316     "//base/test:run_all_unittests",
317     "//base/test:test_support",
318     "//testing/gmock",
319     "//testing/gtest",
320   ]
323 if (is_ios || is_mac) {
324   test("cast_h264_vt_encoder_unittests") {
325     sources = [
326       "sender/h264_vt_encoder_unittest.cc",
327     ]
328     deps = [
329       ":common",
330       ":sender",
331       ":test_support",
332       "//base/test:test_support",
333       "//testing/gmock",
334       "//testing/gtest",
335       "//third_party/ffmpeg",
336     ]
337   }
340 executable("generate_barcode_video") {
341   testonly = true
342   sources = [
343     "test/utility/generate_barcode_video.cc",
344   ]
346   deps = [
347     ":test_support",
348     "//base",
349     "//media",
350   ]
353 executable("generate_timecode_audio") {
354   testonly = true
355   sources = [
356     "test/utility/generate_timecode_audio.cc",
357   ]
359   deps = [
360     ":test_support",
361     "//base",
362     "//media",
363   ]
366 executable("udp_proxy") {
367   testonly = true
368   sources = [
369     "test/utility/udp_proxy_main.cc",
370   ]
372   deps = [
373     ":test_support",
374     "//base",
375     "//net",
376   ]