media.gyp 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. # Copyright (c) 2012 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.
  4. {
  5. 'variables': {
  6. 'chromium_code': 1,
  7. # Override to dynamically link the PulseAudio library.
  8. 'use_pulseaudio%': 0,
  9. # Override to dynamically link the cras (ChromeOS audio) library.
  10. 'use_cras%': 0,
  11. },
  12. 'targets': [
  13. {
  14. 'target_name': 'media',
  15. 'type': '<(component)',
  16. 'dependencies': [
  17. 'yuv_convert',
  18. '../base/base.gyp:base',
  19. '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
  20. '../build/temp_gyp/googleurl.gyp:googleurl',
  21. '../crypto/crypto.gyp:crypto',
  22. '../third_party/openmax/openmax.gyp:il',
  23. '../ui/ui.gyp:ui',
  24. ],
  25. 'defines': [
  26. 'MEDIA_IMPLEMENTATION',
  27. ],
  28. 'include_dirs': [
  29. '..',
  30. ],
  31. 'sources': [
  32. 'audio/android/audio_manager_android.cc',
  33. 'audio/android/audio_manager_android.h',
  34. 'audio/android/audio_track_output_android.cc',
  35. 'audio/android/audio_track_output_android.h',
  36. 'audio/android/opensles_input.cc',
  37. 'audio/android/opensles_input.h',
  38. 'audio/android/opensles_output.cc',
  39. 'audio/android/opensles_output.h',
  40. 'audio/async_socket_io_handler.h',
  41. 'audio/async_socket_io_handler_posix.cc',
  42. 'audio/async_socket_io_handler_win.cc',
  43. 'audio/audio_buffers_state.cc',
  44. 'audio/audio_buffers_state.h',
  45. 'audio/audio_io.h',
  46. 'audio/audio_input_controller.cc',
  47. 'audio/audio_input_controller.h',
  48. 'audio/audio_input_stream_impl.cc',
  49. 'audio/audio_input_stream_impl.h',
  50. 'audio/audio_device_name.cc',
  51. 'audio/audio_device_name.h',
  52. 'audio/audio_manager.cc',
  53. 'audio/audio_manager.h',
  54. 'audio/audio_manager_base.cc',
  55. 'audio/audio_manager_base.h',
  56. 'audio/audio_output_controller.cc',
  57. 'audio/audio_output_controller.h',
  58. 'audio/audio_output_dispatcher.cc',
  59. 'audio/audio_output_dispatcher.h',
  60. 'audio/audio_output_dispatcher_impl.cc',
  61. 'audio/audio_output_dispatcher_impl.h',
  62. 'audio/audio_output_mixer.cc',
  63. 'audio/audio_output_mixer.h',
  64. 'audio/audio_output_proxy.cc',
  65. 'audio/audio_output_proxy.h',
  66. 'audio/audio_parameters.cc',
  67. 'audio/audio_parameters.h',
  68. 'audio/audio_util.cc',
  69. 'audio/audio_util.h',
  70. 'audio/cross_process_notification.cc',
  71. 'audio/cross_process_notification.h',
  72. 'audio/cross_process_notification_win.cc',
  73. 'audio/cross_process_notification_posix.cc',
  74. 'audio/fake_audio_input_stream.cc',
  75. 'audio/fake_audio_input_stream.h',
  76. 'audio/fake_audio_output_stream.cc',
  77. 'audio/fake_audio_output_stream.h',
  78. 'audio/linux/audio_manager_linux.cc',
  79. 'audio/linux/audio_manager_linux.h',
  80. 'audio/linux/alsa_input.cc',
  81. 'audio/linux/alsa_input.h',
  82. 'audio/linux/alsa_output.cc',
  83. 'audio/linux/alsa_output.h',
  84. 'audio/linux/alsa_util.cc',
  85. 'audio/linux/alsa_util.h',
  86. 'audio/linux/alsa_wrapper.cc',
  87. 'audio/linux/alsa_wrapper.h',
  88. 'audio/linux/cras_output.cc',
  89. 'audio/linux/cras_output.h',
  90. 'audio/openbsd/audio_manager_openbsd.cc',
  91. 'audio/openbsd/audio_manager_openbsd.h',
  92. 'audio/mac/audio_input_mac.cc',
  93. 'audio/mac/audio_input_mac.h',
  94. 'audio/mac/audio_low_latency_input_mac.cc',
  95. 'audio/mac/audio_low_latency_input_mac.h',
  96. 'audio/mac/audio_low_latency_output_mac.cc',
  97. 'audio/mac/audio_low_latency_output_mac.h',
  98. 'audio/mac/audio_manager_mac.cc',
  99. 'audio/mac/audio_manager_mac.h',
  100. 'audio/mac/audio_output_mac.cc',
  101. 'audio/mac/audio_output_mac.h',
  102. 'audio/null_audio_sink.cc',
  103. 'audio/null_audio_sink.h',
  104. 'audio/pulse/pulse_output.cc',
  105. 'audio/pulse/pulse_output.h',
  106. 'audio/sample_rates.cc',
  107. 'audio/sample_rates.h',
  108. 'audio/simple_sources.cc',
  109. 'audio/simple_sources.h',
  110. 'audio/win/audio_low_latency_input_win.cc',
  111. 'audio/win/audio_low_latency_input_win.h',
  112. 'audio/win/audio_low_latency_output_win.cc',
  113. 'audio/win/audio_low_latency_output_win.h',
  114. 'audio/win/audio_manager_win.cc',
  115. 'audio/win/audio_manager_win.h',
  116. 'audio/win/avrt_wrapper_win.cc',
  117. 'audio/win/avrt_wrapper_win.h',
  118. 'audio/win/device_enumeration_win.cc',
  119. 'audio/win/device_enumeration_win.h',
  120. 'audio/win/wavein_input_win.cc',
  121. 'audio/win/wavein_input_win.h',
  122. 'audio/win/waveout_output_win.cc',
  123. 'audio/win/waveout_output_win.h',
  124. 'base/android/media_jni_registrar.cc',
  125. 'base/android/media_jni_registrar.h',
  126. 'base/audio_decoder.cc',
  127. 'base/audio_decoder.h',
  128. 'base/audio_decoder_config.cc',
  129. 'base/audio_decoder_config.h',
  130. 'base/audio_renderer.h',
  131. 'base/audio_renderer_mixer.cc',
  132. 'base/audio_renderer_mixer.h',
  133. 'base/audio_renderer_mixer_input.cc',
  134. 'base/audio_renderer_mixer_input.h',
  135. 'base/bitstream_buffer.h',
  136. 'base/buffers.cc',
  137. 'base/buffers.h',
  138. 'base/byte_queue.cc',
  139. 'base/byte_queue.h',
  140. 'base/channel_layout.cc',
  141. 'base/channel_layout.h',
  142. 'base/clock.cc',
  143. 'base/clock.h',
  144. 'base/composite_filter.cc',
  145. 'base/composite_filter.h',
  146. 'base/data_buffer.cc',
  147. 'base/data_buffer.h',
  148. 'base/data_source.cc',
  149. 'base/data_source.h',
  150. 'base/decoder_buffer.cc',
  151. 'base/decoder_buffer.h',
  152. 'base/decrypt_config.cc',
  153. 'base/decrypt_config.h',
  154. 'base/decryptor.h',
  155. 'base/decryptor_client.h',
  156. 'base/demuxer.cc',
  157. 'base/demuxer.h',
  158. 'base/demuxer_stream.cc',
  159. 'base/demuxer_stream.h',
  160. 'base/djb2.cc',
  161. 'base/djb2.h',
  162. 'base/filter_collection.cc',
  163. 'base/filter_collection.h',
  164. 'base/filter_host.h',
  165. 'base/filters.cc',
  166. 'base/filters.h',
  167. 'base/h264_bitstream_converter.cc',
  168. 'base/h264_bitstream_converter.h',
  169. 'base/media.h',
  170. 'base/media_android.cc',
  171. 'base/media_export.h',
  172. 'base/media_log.cc',
  173. 'base/media_log.h',
  174. 'base/media_log_event.h',
  175. 'base/media_posix.cc',
  176. 'base/media_switches.cc',
  177. 'base/media_switches.h',
  178. 'base/media_win.cc',
  179. 'base/message_loop_factory.cc',
  180. 'base/message_loop_factory.h',
  181. 'base/pipeline.cc',
  182. 'base/pipeline.h',
  183. 'base/pipeline_status.cc',
  184. 'base/pipeline_status.h',
  185. 'base/ranges.cc',
  186. 'base/ranges.h',
  187. 'base/seekable_buffer.cc',
  188. 'base/seekable_buffer.h',
  189. 'base/state_matrix.cc',
  190. 'base/state_matrix.h',
  191. 'base/stream_parser.cc',
  192. 'base/stream_parser.h',
  193. 'base/stream_parser_buffer.cc',
  194. 'base/stream_parser_buffer.h',
  195. 'base/video_decoder.cc',
  196. 'base/video_decoder.h',
  197. 'base/video_decoder_config.cc',
  198. 'base/video_decoder_config.h',
  199. 'base/video_frame.cc',
  200. 'base/video_frame.h',
  201. 'base/video_renderer.h',
  202. 'base/video_util.cc',
  203. 'base/video_util.h',
  204. 'crypto/aes_decryptor.cc',
  205. 'crypto/aes_decryptor.h',
  206. 'ffmpeg/ffmpeg_common.cc',
  207. 'ffmpeg/ffmpeg_common.h',
  208. 'ffmpeg/file_protocol.cc',
  209. 'ffmpeg/file_protocol.h',
  210. 'filters/audio_file_reader.cc',
  211. 'filters/audio_file_reader.h',
  212. 'filters/audio_renderer_algorithm.cc',
  213. 'filters/audio_renderer_algorithm.h',
  214. 'filters/audio_renderer_impl.cc',
  215. 'filters/audio_renderer_impl.h',
  216. 'filters/bitstream_converter.cc',
  217. 'filters/bitstream_converter.h',
  218. 'filters/chunk_demuxer.cc',
  219. 'filters/chunk_demuxer.h',
  220. 'filters/chunk_demuxer_client.h',
  221. 'filters/dummy_demuxer.cc',
  222. 'filters/dummy_demuxer.h',
  223. 'filters/ffmpeg_audio_decoder.cc',
  224. 'filters/ffmpeg_audio_decoder.h',
  225. 'filters/ffmpeg_demuxer.cc',
  226. 'filters/ffmpeg_demuxer.h',
  227. 'filters/ffmpeg_h264_bitstream_converter.cc',
  228. 'filters/ffmpeg_h264_bitstream_converter.h',
  229. 'filters/ffmpeg_glue.cc',
  230. 'filters/ffmpeg_glue.h',
  231. 'filters/ffmpeg_video_decoder.cc',
  232. 'filters/ffmpeg_video_decoder.h',
  233. 'filters/file_data_source.cc',
  234. 'filters/file_data_source.h',
  235. 'filters/gpu_video_decoder.cc',
  236. 'filters/gpu_video_decoder.h',
  237. 'filters/in_memory_url_protocol.cc',
  238. 'filters/in_memory_url_protocol.h',
  239. 'filters/source_buffer_stream.cc',
  240. 'filters/source_buffer_stream.h',
  241. 'filters/video_frame_generator.cc',
  242. 'filters/video_frame_generator.h',
  243. 'filters/video_renderer_base.cc',
  244. 'filters/video_renderer_base.h',
  245. 'video/capture/fake_video_capture_device.cc',
  246. 'video/capture/fake_video_capture_device.h',
  247. 'video/capture/linux/video_capture_device_linux.cc',
  248. 'video/capture/linux/video_capture_device_linux.h',
  249. 'video/capture/mac/video_capture_device_mac.h',
  250. 'video/capture/mac/video_capture_device_mac.mm',
  251. 'video/capture/mac/video_capture_device_qtkit_mac.h',
  252. 'video/capture/mac/video_capture_device_qtkit_mac.mm',
  253. 'video/capture/video_capture.h',
  254. 'video/capture/video_capture_device.h',
  255. 'video/capture/video_capture_device_dummy.cc',
  256. 'video/capture/video_capture_device_dummy.h',
  257. 'video/capture/video_capture_proxy.cc',
  258. 'video/capture/video_capture_proxy.h',
  259. 'video/capture/video_capture_types.h',
  260. 'video/capture/win/filter_base_win.cc',
  261. 'video/capture/win/filter_base_win.h',
  262. 'video/capture/win/pin_base_win.cc',
  263. 'video/capture/win/pin_base_win.h',
  264. 'video/capture/win/sink_filter_observer_win.h',
  265. 'video/capture/win/sink_filter_win.cc',
  266. 'video/capture/win/sink_filter_win.h',
  267. 'video/capture/win/sink_input_pin_win.cc',
  268. 'video/capture/win/sink_input_pin_win.h',
  269. 'video/capture/win/video_capture_device_win.cc',
  270. 'video/capture/win/video_capture_device_win.h',
  271. 'video/picture.cc',
  272. 'video/picture.h',
  273. 'video/video_decode_accelerator.cc',
  274. 'video/video_decode_accelerator.h',
  275. 'webm/webm_constants.h',
  276. 'webm/webm_cluster_parser.cc',
  277. 'webm/webm_cluster_parser.h',
  278. 'webm/webm_content_encodings.cc',
  279. 'webm/webm_content_encodings.h',
  280. 'webm/webm_content_encodings_client.cc',
  281. 'webm/webm_content_encodings_client.h',
  282. 'webm/webm_info_parser.cc',
  283. 'webm/webm_info_parser.h',
  284. 'webm/webm_parser.cc',
  285. 'webm/webm_parser.h',
  286. 'webm/webm_stream_parser.cc',
  287. 'webm/webm_stream_parser.h',
  288. 'webm/webm_tracks_parser.cc',
  289. 'webm/webm_tracks_parser.h',
  290. ],
  291. 'direct_dependent_settings': {
  292. 'include_dirs': [
  293. '..',
  294. ],
  295. },
  296. 'conditions': [
  297. # Android doesn't use ffmpeg, so make the dependency conditional
  298. # and exclude the sources which depend on ffmpeg.
  299. ['OS != "android"', {
  300. 'dependencies': [
  301. '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
  302. ],
  303. }],
  304. ['OS == "android"', {
  305. 'sources!': [
  306. 'base/media_posix.cc',
  307. 'ffmpeg/ffmpeg_common.cc',
  308. 'ffmpeg/ffmpeg_common.h',
  309. 'ffmpeg/file_protocol.cc',
  310. 'ffmpeg/file_protocol.h',
  311. 'filters/audio_file_reader.cc',
  312. 'filters/audio_file_reader.h',
  313. 'filters/bitstream_converter.cc',
  314. 'filters/bitstream_converter.h',
  315. 'filters/chunk_demuxer.cc',
  316. 'filters/chunk_demuxer.h',
  317. 'filters/chunk_demuxer_client.h',
  318. 'filters/ffmpeg_audio_decoder.cc',
  319. 'filters/ffmpeg_audio_decoder.h',
  320. 'filters/ffmpeg_demuxer.cc',
  321. 'filters/ffmpeg_demuxer.h',
  322. 'filters/ffmpeg_h264_bitstream_converter.cc',
  323. 'filters/ffmpeg_h264_bitstream_converter.h',
  324. 'filters/ffmpeg_glue.cc',
  325. 'filters/ffmpeg_glue.h',
  326. 'filters/ffmpeg_video_decoder.cc',
  327. 'filters/ffmpeg_video_decoder.h',
  328. 'filters/gpu_video_decoder.cc',
  329. 'filters/gpu_video_decoder.h',
  330. 'webm/webm_cluster_parser.cc',
  331. 'webm/webm_cluster_parser.h',
  332. 'webm/webm_stream_parser.cc',
  333. 'webm/webm_stream_parser.h',
  334. ],
  335. }],
  336. # The below 'android' condition were added temporarily and should be
  337. # removed in downstream, because there is no Java environment setup in
  338. # upstream yet.
  339. ['OS == "android"', {
  340. 'sources!':[
  341. 'audio/android/audio_track_output_android.cc',
  342. ],
  343. 'sources':[
  344. 'audio/android/audio_track_output_stub_android.cc',
  345. ],
  346. 'link_settings': {
  347. 'libraries': [
  348. '-lOpenSLES',
  349. ],
  350. },
  351. }],
  352. ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
  353. 'link_settings': {
  354. 'libraries': [
  355. '-lasound',
  356. ],
  357. },
  358. }],
  359. ['OS=="openbsd"', {
  360. 'sources/': [ ['exclude', '/alsa_' ],
  361. ['exclude', '/audio_manager_linux' ] ],
  362. 'link_settings': {
  363. 'libraries': [
  364. ],
  365. },
  366. }],
  367. ['OS!="openbsd"', {
  368. 'sources!': [
  369. 'audio/openbsd/audio_manager_openbsd.cc',
  370. 'audio/openbsd/audio_manager_openbsd.h',
  371. ],
  372. }],
  373. ['OS=="linux"', {
  374. 'variables': {
  375. 'conditions': [
  376. ['sysroot!=""', {
  377. 'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
  378. }, {
  379. 'pkg-config': 'pkg-config'
  380. }],
  381. ],
  382. },
  383. 'conditions': [
  384. ['use_cras == 1', {
  385. 'cflags': [
  386. '<!@(<(pkg-config) --cflags libcras)',
  387. ],
  388. 'link_settings': {
  389. 'libraries': [
  390. '<!@(<(pkg-config) --libs libcras)',
  391. ],
  392. },
  393. 'defines': [
  394. 'USE_CRAS',
  395. ],
  396. }, { # else: use_cras == 0
  397. 'sources!': [
  398. 'audio/linux/cras_output.cc',
  399. 'audio/linux/cras_output.h',
  400. ],
  401. }],
  402. ],
  403. }],
  404. ['os_posix == 1', {
  405. 'conditions': [
  406. ['use_pulseaudio == 1', {
  407. 'cflags': [
  408. '<!@(pkg-config --cflags libpulse)',
  409. ],
  410. 'link_settings': {
  411. 'libraries': [
  412. '<!@(pkg-config --libs-only-l libpulse)',
  413. ],
  414. },
  415. 'defines': [
  416. 'USE_PULSEAUDIO',
  417. ],
  418. }, { # else: use_pulseaudio == 0
  419. 'sources!': [
  420. 'audio/pulse/pulse_output.cc',
  421. 'audio/pulse/pulse_output.h',
  422. ],
  423. }],
  424. ],
  425. }],
  426. ['os_posix == 1 and OS != "android"', {
  427. # Video capture isn't supported in Android yet.
  428. 'sources!': [
  429. 'video/capture/video_capture_device_dummy.cc',
  430. 'video/capture/video_capture_device_dummy.h',
  431. ],
  432. }],
  433. ['OS=="mac"', {
  434. 'link_settings': {
  435. 'libraries': [
  436. '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
  437. '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
  438. '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
  439. '$(SDKROOT)/System/Library/Frameworks/CoreVideo.framework',
  440. '$(SDKROOT)/System/Library/Frameworks/QTKit.framework',
  441. ],
  442. },
  443. }],
  444. ['OS=="win"', {
  445. 'sources!': [
  446. 'audio/pulse/pulse_output.cc',
  447. 'audio/pulse/pulse_output.h',
  448. 'video/capture/video_capture_device_dummy.cc',
  449. 'video/capture/video_capture_device_dummy.h',
  450. ],
  451. }],
  452. ['proprietary_codecs==1 or branding=="Chrome"', {
  453. 'sources': [
  454. 'mp4/avc.cc',
  455. 'mp4/avc.h',
  456. 'mp4/box_definitions.cc',
  457. 'mp4/box_definitions.h',
  458. 'mp4/box_reader.cc',
  459. 'mp4/box_reader.h',
  460. 'mp4/cenc.cc',
  461. 'mp4/cenc.h',
  462. 'mp4/mp4_stream_parser.cc',
  463. 'mp4/mp4_stream_parser.h',
  464. 'mp4/offset_byte_queue.cc',
  465. 'mp4/offset_byte_queue.h',
  466. 'mp4/track_run_iterator.cc',
  467. 'mp4/track_run_iterator.h',
  468. ],
  469. }],
  470. ],
  471. },
  472. {
  473. 'target_name': 'yuv_convert',
  474. 'type': 'static_library',
  475. 'include_dirs': [
  476. '..',
  477. ],
  478. 'conditions': [
  479. ['order_profiling != 0', {
  480. 'target_conditions' : [
  481. ['_toolset=="target"', {
  482. 'cflags!': [ '-finstrument-functions' ],
  483. }],
  484. ],
  485. }],
  486. [ 'target_arch == "ia32" or target_arch == "x64"', {
  487. 'dependencies': [
  488. 'yuv_convert_simd_x86',
  489. ],
  490. }],
  491. [ 'target_arch == "arm"', {
  492. 'dependencies': [
  493. 'yuv_convert_simd_arm',
  494. ],
  495. }],
  496. ],
  497. 'sources': [
  498. 'base/yuv_convert.cc',
  499. 'base/yuv_convert.h',
  500. ],
  501. },
  502. {
  503. 'target_name': 'yuv_convert_simd_x86',
  504. 'type': 'static_library',
  505. 'include_dirs': [
  506. '..',
  507. ],
  508. 'sources': [
  509. 'base/simd/convert_rgb_to_yuv_c.cc',
  510. 'base/simd/convert_rgb_to_yuv_sse2.cc',
  511. 'base/simd/convert_rgb_to_yuv_ssse3.asm',
  512. 'base/simd/convert_rgb_to_yuv_ssse3.cc',
  513. 'base/simd/convert_rgb_to_yuv_ssse3.inc',
  514. 'base/simd/convert_yuv_to_rgb_c.cc',
  515. 'base/simd/convert_yuv_to_rgb_x86.cc',
  516. 'base/simd/convert_yuv_to_rgb_mmx.asm',
  517. 'base/simd/convert_yuv_to_rgb_mmx.inc',
  518. 'base/simd/convert_yuv_to_rgb_sse.asm',
  519. 'base/simd/filter_yuv.h',
  520. 'base/simd/filter_yuv_c.cc',
  521. 'base/simd/filter_yuv_mmx.cc',
  522. 'base/simd/filter_yuv_sse2.cc',
  523. 'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
  524. 'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
  525. 'base/simd/linear_scale_yuv_to_rgb_sse.asm',
  526. 'base/simd/scale_yuv_to_rgb_mmx.asm',
  527. 'base/simd/scale_yuv_to_rgb_mmx.inc',
  528. 'base/simd/scale_yuv_to_rgb_sse.asm',
  529. 'base/simd/yuv_to_rgb_table.cc',
  530. 'base/simd/yuv_to_rgb_table.h',
  531. ],
  532. 'conditions': [
  533. ['order_profiling != 0', {
  534. 'target_conditions' : [
  535. ['_toolset=="target"', {
  536. 'cflags!': [ '-finstrument-functions' ],
  537. }],
  538. ],
  539. }],
  540. [ 'target_arch == "x64"', {
  541. # Source files optimized for X64 systems.
  542. 'sources': [
  543. 'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
  544. 'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
  545. ],
  546. }],
  547. [ 'os_posix == 1 and OS != "mac" and OS != "android"', {
  548. 'cflags': [
  549. '-msse2',
  550. ],
  551. }],
  552. [ 'OS == "mac"', {
  553. 'configurations': {
  554. 'Debug': {
  555. 'xcode_settings': {
  556. # gcc on the mac builds horribly unoptimized sse code in debug
  557. # mode. Since this is rarely going to be debugged, run with full
  558. # optimizations in Debug as well as Release.
  559. 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
  560. },
  561. },
  562. },
  563. }],
  564. [ 'OS=="win"', {
  565. 'variables': {
  566. 'yasm_flags': [
  567. '-DWIN32',
  568. '-DMSVC',
  569. '-DCHROMIUM',
  570. '-Isimd',
  571. ],
  572. },
  573. }],
  574. [ 'OS=="mac"', {
  575. 'variables': {
  576. 'yasm_flags': [
  577. '-DPREFIX',
  578. '-DMACHO',
  579. '-DCHROMIUM',
  580. '-Isimd',
  581. ],
  582. },
  583. }],
  584. [ 'os_posix==1 and OS!="mac"', {
  585. 'variables': {
  586. 'conditions': [
  587. [ 'target_arch=="ia32"', {
  588. 'yasm_flags': [
  589. '-DX86_32',
  590. '-DELF',
  591. '-DCHROMIUM',
  592. '-Isimd',
  593. ],
  594. }, {
  595. 'yasm_flags': [
  596. '-DARCH_X86_64',
  597. '-DELF',
  598. '-DPIC',
  599. '-DCHROMIUM',
  600. '-Isimd',
  601. ],
  602. }],
  603. ],
  604. },
  605. }],
  606. ],
  607. 'variables': {
  608. 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
  609. },
  610. 'msvs_2010_disable_uldi_when_referenced': 1,
  611. 'includes': [
  612. '../third_party/yasm/yasm_compile.gypi',
  613. ],
  614. },
  615. {
  616. 'target_name': 'yuv_convert_simd_arm',
  617. 'type': 'static_library',
  618. 'include_dirs': [
  619. '..',
  620. ],
  621. 'sources': [
  622. 'base/simd/convert_rgb_to_yuv_c.cc',
  623. 'base/simd/convert_rgb_to_yuv.h',
  624. 'base/simd/convert_yuv_to_rgb_c.cc',
  625. 'base/simd/convert_yuv_to_rgb.h',
  626. 'base/simd/filter_yuv.h',
  627. 'base/simd/filter_yuv_c.cc',
  628. 'base/simd/yuv_to_rgb_table.cc',
  629. 'base/simd/yuv_to_rgb_table.h',
  630. ],
  631. },
  632. {
  633. 'target_name': 'media_unittests',
  634. 'type': 'executable',
  635. 'dependencies': [
  636. 'media',
  637. 'media_test_support',
  638. 'yuv_convert',
  639. '../base/base.gyp:base',
  640. '../base/base.gyp:base_i18n',
  641. '../base/base.gyp:test_support_base',
  642. '../testing/gmock.gyp:gmock',
  643. '../testing/gtest.gyp:gtest',
  644. '../ui/ui.gyp:ui',
  645. ],
  646. 'sources': [
  647. 'audio/async_socket_io_handler_unittest.cc',
  648. 'audio/audio_input_controller_unittest.cc',
  649. 'audio/audio_input_device_unittest.cc',
  650. 'audio/audio_input_unittest.cc',
  651. 'audio/audio_input_volume_unittest.cc',
  652. 'audio/audio_low_latency_input_output_unittest.cc',
  653. 'audio/audio_output_controller_unittest.cc',
  654. 'audio/audio_output_proxy_unittest.cc',
  655. 'audio/audio_parameters_unittest.cc',
  656. 'audio/audio_util_unittest.cc',
  657. 'audio/cross_process_notification_unittest.cc',
  658. 'audio/linux/alsa_output_unittest.cc',
  659. 'audio/mac/audio_low_latency_input_mac_unittest.cc',
  660. 'audio/mac/audio_output_mac_unittest.cc',
  661. 'audio/simple_sources_unittest.cc',
  662. 'audio/win/audio_low_latency_input_win_unittest.cc',
  663. 'audio/win/audio_low_latency_output_win_unittest.cc',
  664. 'audio/win/audio_output_win_unittest.cc',
  665. 'base/audio_renderer_mixer_unittest.cc',
  666. 'base/audio_renderer_mixer_input_unittest.cc',
  667. 'base/buffers_unittest.cc',
  668. 'base/clock_unittest.cc',
  669. 'base/composite_filter_unittest.cc',
  670. 'base/data_buffer_unittest.cc',
  671. 'base/decoder_buffer_unittest.cc',
  672. 'base/djb2_unittest.cc',
  673. 'base/fake_audio_render_callback.cc',
  674. 'base/fake_audio_render_callback.h',
  675. 'base/filter_collection_unittest.cc',
  676. 'base/h264_bitstream_converter_unittest.cc',
  677. 'base/pipeline_unittest.cc',
  678. 'base/ranges_unittest.cc',
  679. 'base/run_all_unittests.cc',
  680. 'base/seekable_buffer_unittest.cc',
  681. 'base/state_matrix_unittest.cc',
  682. 'base/test_data_util.cc',
  683. 'base/test_data_util.h',
  684. 'base/video_frame_unittest.cc',
  685. 'base/video_util_unittest.cc',
  686. 'base/yuv_convert_unittest.cc',
  687. 'crypto/aes_decryptor_unittest.cc',
  688. 'ffmpeg/ffmpeg_common_unittest.cc',
  689. 'filters/audio_renderer_algorithm_unittest.cc',
  690. 'filters/audio_renderer_impl_unittest.cc',
  691. 'filters/bitstream_converter_unittest.cc',
  692. 'filters/chunk_demuxer_unittest.cc',
  693. 'filters/ffmpeg_audio_decoder_unittest.cc',
  694. 'filters/ffmpeg_decoder_unittest.h',
  695. 'filters/ffmpeg_demuxer_unittest.cc',
  696. 'filters/ffmpeg_glue_unittest.cc',
  697. 'filters/ffmpeg_h264_bitstream_converter_unittest.cc',
  698. 'filters/ffmpeg_video_decoder_unittest.cc',
  699. 'filters/file_data_source_unittest.cc',
  700. 'filters/pipeline_integration_test.cc',
  701. 'filters/pipeline_integration_test_base.cc',
  702. 'filters/source_buffer_stream_unittest.cc',
  703. 'filters/video_renderer_base_unittest.cc',
  704. 'video/capture/video_capture_device_unittest.cc',
  705. 'webm/cluster_builder.cc',
  706. 'webm/cluster_builder.h',
  707. 'webm/webm_cluster_parser_unittest.cc',
  708. 'webm/webm_content_encodings_client_unittest.cc',
  709. 'webm/webm_parser_unittest.cc',
  710. ],
  711. 'conditions': [
  712. ['os_posix==1 and OS!="mac"', {
  713. 'conditions': [
  714. ['linux_use_tcmalloc==1', {
  715. 'dependencies': [
  716. '../base/allocator/allocator.gyp:allocator',
  717. ],
  718. }],
  719. ],
  720. }],
  721. ['OS != "android"', {
  722. 'dependencies': [
  723. '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
  724. ],
  725. }],
  726. ['OS == "android"', {
  727. 'sources!': [
  728. 'audio/audio_input_volume_unittest.cc',
  729. 'base/test_data_util.cc',
  730. 'base/test_data_util.h',
  731. 'ffmpeg/ffmpeg_common_unittest.cc',
  732. 'filters/ffmpeg_audio_decoder_unittest.cc',
  733. 'filters/bitstream_converter_unittest.cc',
  734. 'filters/chunk_demuxer_unittest.cc',
  735. 'filters/ffmpeg_demuxer_unittest.cc',
  736. 'filters/ffmpeg_glue_unittest.cc',
  737. 'filters/ffmpeg_h264_bitstream_converter_unittest.cc',
  738. 'filters/ffmpeg_video_decoder_unittest.cc',
  739. 'filters/pipeline_integration_test.cc',
  740. 'filters/pipeline_integration_test_base.cc',
  741. 'mp4/mp4_stream_parser_unittest.cc',
  742. 'webm/webm_cluster_parser_unittest.cc',
  743. ],
  744. }],
  745. ['OS == "linux"', {
  746. 'conditions': [
  747. ['use_cras == 1', {
  748. 'sources': [
  749. 'audio/linux/cras_output_unittest.cc',
  750. ],
  751. 'defines': [
  752. 'USE_CRAS',
  753. ],
  754. }],
  755. ],
  756. }],
  757. [ 'target_arch=="ia32" or target_arch=="x64"', {
  758. 'sources': [
  759. 'base/simd/convert_rgb_to_yuv_unittest.cc',
  760. ],
  761. }],
  762. ['proprietary_codecs==1 or branding=="Chrome"', {
  763. 'sources': [
  764. 'mp4/avc_unittest.cc',
  765. 'mp4/box_reader_unittest.cc',
  766. 'mp4/mp4_stream_parser_unittest.cc',
  767. 'mp4/offset_byte_queue_unittest.cc',
  768. ],
  769. }],
  770. ],
  771. },
  772. {
  773. 'target_name': 'media_test_support',
  774. 'type': 'static_library',
  775. 'dependencies': [
  776. 'media',
  777. '../base/base.gyp:base',
  778. '../testing/gmock.gyp:gmock',
  779. '../testing/gtest.gyp:gtest',
  780. ],
  781. 'sources': [
  782. 'audio/test_audio_input_controller_factory.cc',
  783. 'audio/test_audio_input_controller_factory.h',
  784. 'base/mock_callback.cc',
  785. 'base/mock_callback.h',
  786. 'base/mock_data_source_host.cc',
  787. 'base/mock_data_source_host.h',
  788. 'base/mock_demuxer_host.cc',
  789. 'base/mock_demuxer_host.h',
  790. 'base/mock_filter_host.cc',
  791. 'base/mock_filter_host.h',
  792. 'base/mock_filters.cc',
  793. 'base/mock_filters.h',
  794. ],
  795. },
  796. {
  797. 'target_name': 'scaler_bench',
  798. 'type': 'executable',
  799. 'dependencies': [
  800. 'media',
  801. 'yuv_convert',
  802. '../base/base.gyp:base',
  803. '../skia/skia.gyp:skia',
  804. ],
  805. 'sources': [
  806. 'tools/scaler_bench/scaler_bench.cc',
  807. ],
  808. },
  809. {
  810. 'target_name': 'qt_faststart',
  811. 'type': 'executable',
  812. 'sources': [
  813. 'tools/qt_faststart/qt_faststart.c'
  814. ],
  815. },
  816. {
  817. 'target_name': 'seek_tester',
  818. 'type': 'executable',
  819. 'dependencies': [
  820. 'media',
  821. '../base/base.gyp:base',
  822. ],
  823. 'sources': [
  824. 'tools/seek_tester/seek_tester.cc',
  825. ],
  826. },
  827. ],
  828. 'conditions': [
  829. ['OS=="win"', {
  830. 'targets': [
  831. {
  832. 'target_name': 'player_wtl',
  833. 'type': 'executable',
  834. 'dependencies': [
  835. 'media',
  836. 'yuv_convert',
  837. '../base/base.gyp:base',
  838. '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
  839. '../ui/ui.gyp:ui',
  840. ],
  841. 'include_dirs': [
  842. '<(DEPTH)/third_party/wtl/include',
  843. ],
  844. 'sources': [
  845. 'tools/player_wtl/list.h',
  846. 'tools/player_wtl/mainfrm.h',
  847. 'tools/player_wtl/movie.cc',
  848. 'tools/player_wtl/movie.h',
  849. 'tools/player_wtl/player_wtl.cc',
  850. 'tools/player_wtl/player_wtl.rc',
  851. 'tools/player_wtl/props.h',
  852. 'tools/player_wtl/seek.h',
  853. 'tools/player_wtl/resource.h',
  854. 'tools/player_wtl/view.h',
  855. ],
  856. 'msvs_settings': {
  857. 'VCLinkerTool': {
  858. 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
  859. },
  860. },
  861. 'defines': [
  862. '_CRT_SECURE_NO_WARNINGS=1',
  863. ],
  864. },
  865. ],
  866. }],
  867. ['OS == "win" or toolkit_uses_gtk == 1', {
  868. 'targets': [
  869. {
  870. 'target_name': 'shader_bench',
  871. 'type': 'executable',
  872. 'dependencies': [
  873. 'media',
  874. 'yuv_convert',
  875. '../base/base.gyp:base',
  876. '../ui/gl/gl.gyp:gl',
  877. ],
  878. 'sources': [
  879. 'tools/shader_bench/shader_bench.cc',
  880. 'tools/shader_bench/cpu_color_painter.cc',
  881. 'tools/shader_bench/cpu_color_painter.h',
  882. 'tools/shader_bench/gpu_color_painter.cc',
  883. 'tools/shader_bench/gpu_color_painter.h',
  884. 'tools/shader_bench/gpu_painter.cc',
  885. 'tools/shader_bench/gpu_painter.h',
  886. 'tools/shader_bench/painter.cc',
  887. 'tools/shader_bench/painter.h',
  888. 'tools/shader_bench/window.cc',
  889. 'tools/shader_bench/window.h',
  890. ],
  891. 'conditions': [
  892. ['toolkit_uses_gtk == 1', {
  893. 'dependencies': [
  894. '../build/linux/system.gyp:gtk',
  895. ],
  896. 'sources': [
  897. 'tools/shader_bench/window_linux.cc',
  898. ],
  899. }],
  900. ['OS=="win"', {
  901. 'dependencies': [
  902. '../third_party/angle/src/build_angle.gyp:libEGL',
  903. '../third_party/angle/src/build_angle.gyp:libGLESv2',
  904. ],
  905. 'sources': [
  906. 'tools/shader_bench/window_win.cc',
  907. ],
  908. }],
  909. ],
  910. },
  911. ],
  912. }],
  913. ['OS == "linux" and target_arch != "arm"', {
  914. 'targets': [
  915. {
  916. 'target_name': 'tile_render_bench',
  917. 'type': 'executable',
  918. 'dependencies': [
  919. '../base/base.gyp:base',
  920. '../ui/gl/gl.gyp:gl',
  921. ],
  922. 'libraries': [
  923. '-lGL',
  924. '-ldl',
  925. ],
  926. 'sources': [
  927. 'tools/tile_render_bench/tile_render_bench.cc',
  928. ],
  929. },
  930. ],
  931. }],
  932. ['os_posix == 1 and OS != "mac" and OS != "android"', {
  933. 'targets': [
  934. {
  935. 'target_name': 'player_x11',
  936. 'type': 'executable',
  937. 'dependencies': [
  938. 'media',
  939. 'yuv_convert',
  940. '../base/base.gyp:base',
  941. '../ui/gl/gl.gyp:gl',
  942. ],
  943. 'link_settings': {
  944. 'libraries': [
  945. '-ldl',
  946. '-lX11',
  947. '-lXrender',
  948. '-lXext',
  949. ],
  950. },
  951. 'sources': [
  952. 'tools/player_x11/data_source_logger.cc',
  953. 'tools/player_x11/data_source_logger.h',
  954. 'tools/player_x11/gl_video_renderer.cc',
  955. 'tools/player_x11/gl_video_renderer.h',
  956. 'tools/player_x11/player_x11.cc',
  957. 'tools/player_x11/x11_video_renderer.cc',
  958. 'tools/player_x11/x11_video_renderer.h',
  959. ],
  960. },
  961. ],
  962. }],
  963. ['OS == "android"', {
  964. 'targets': [
  965. {
  966. 'target_name': 'player_android',
  967. 'type': 'static_library',
  968. 'sources': [
  969. 'base/android/media_player_bridge.cc',
  970. 'base/android/media_player_bridge.h',
  971. ],
  972. 'dependencies': [
  973. '../base/base.gyp:base',
  974. ],
  975. 'include_dirs': [
  976. '<(SHARED_INTERMEDIATE_DIR)/media',
  977. ],
  978. 'actions': [
  979. {
  980. 'action_name': 'generate-jni-headers',
  981. 'inputs': [
  982. '../base/android/jni_generator/jni_generator.py',
  983. 'base/android/java/src/org/chromium/media/MediaPlayerListener.java',
  984. ],
  985. 'outputs': [
  986. '<(SHARED_INTERMEDIATE_DIR)/media/jni/media_player_listener_jni.h',
  987. ],
  988. 'action': [
  989. 'python',
  990. '<(DEPTH)/base/android/jni_generator/jni_generator.py',
  991. '-o',
  992. '<@(_inputs)',
  993. '<@(_outputs)',
  994. ],
  995. },
  996. ],
  997. },
  998. {
  999. 'target_name': 'media_java',
  1000. 'type': 'none',
  1001. 'dependencies': [ '../base/base.gyp:base_java' ],
  1002. 'variables': {
  1003. 'package_name': 'media',
  1004. 'java_in_dir': 'base/android/java',
  1005. },
  1006. 'includes': [ '../build/java.gypi' ],
  1007. },
  1008. ],
  1009. }, { # OS != "android"'
  1010. # Android does not use ffmpeg, so disable the targets which require it.
  1011. 'targets': [
  1012. {
  1013. 'target_name': 'ffmpeg_unittests',
  1014. 'type': 'executable',
  1015. 'dependencies': [
  1016. 'media',
  1017. 'media_test_support',
  1018. '../base/base.gyp:base',
  1019. '../base/base.gyp:base_i18n',
  1020. '../base/base.gyp:test_support_base',
  1021. '../base/base.gyp:test_support_perf',
  1022. '../testing/gtest.gyp:gtest',
  1023. '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
  1024. ],
  1025. 'sources': [
  1026. 'ffmpeg/ffmpeg_unittest.cc',
  1027. ],
  1028. 'conditions': [
  1029. ['toolkit_uses_gtk == 1', {
  1030. 'dependencies': [
  1031. # Needed for the following #include chain:
  1032. # base/run_all_unittests.cc
  1033. # ../base/test_suite.h
  1034. # gtk/gtk.h
  1035. '../build/linux/system.gyp:gtk',
  1036. ],
  1037. 'conditions': [
  1038. ['linux_use_tcmalloc==1', {
  1039. 'dependencies': [
  1040. '../base/allocator/allocator.gyp:allocator',
  1041. ],
  1042. }],
  1043. ],
  1044. }],
  1045. ],
  1046. },
  1047. {
  1048. 'target_name': 'ffmpeg_regression_tests',
  1049. 'type': 'executable',
  1050. 'dependencies': [
  1051. 'media',
  1052. 'media_test_support',
  1053. '../base/base.gyp:test_support_base',
  1054. '../testing/gmock.gyp:gmock',
  1055. '../testing/gtest.gyp:gtest',
  1056. '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
  1057. ],
  1058. 'sources': [
  1059. 'base/test_data_util.cc',
  1060. 'base/run_all_unittests.cc',
  1061. 'ffmpeg/ffmpeg_regression_tests.cc',
  1062. 'filters/pipeline_integration_test_base.cc',
  1063. ],
  1064. 'conditions': [
  1065. ['os_posix==1 and OS!="mac"', {
  1066. 'conditions': [
  1067. ['linux_use_tcmalloc==1', {
  1068. 'dependencies': [
  1069. '../base/allocator/allocator.gyp:allocator',
  1070. ],
  1071. }],
  1072. ],
  1073. }],
  1074. ],
  1075. },
  1076. {
  1077. 'target_name': 'ffmpeg_tests',
  1078. 'type': 'executable',
  1079. 'dependencies': [
  1080. 'media',
  1081. '../base/base.gyp:base',
  1082. '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
  1083. ],
  1084. 'sources': [
  1085. 'test/ffmpeg_tests/ffmpeg_tests.cc',
  1086. ],
  1087. },
  1088. {
  1089. 'target_name': 'media_bench',
  1090. 'type': 'executable',
  1091. 'dependencies': [
  1092. 'media',
  1093. '../base/base.gyp:base',
  1094. '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
  1095. ],
  1096. 'sources': [
  1097. 'tools/media_bench/media_bench.cc',
  1098. ],
  1099. },
  1100. ],
  1101. }]
  1102. ],
  1103. }