[Fallback icons] Redoing http://crrev.com/988863002/, fixing use-after-free bug.
[chromium-blink-merge.git] / media / media_cdm.gypi
blob7d927324ac31de75805f8d3fc56c59e0947fa06c
1 # Copyright 2013 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.
6   'variables': {
7     'conditions': [
8       ['OS == "android"', {
9         # Android doesn't use ffmpeg.
10         'use_ffmpeg%': 0,
11       }, {  # 'OS != "android"'
12         'use_ffmpeg%': 1,
13       }],
14     ],
15     # Set |use_fake_video_decoder| to 1 to ignore input frames in |clearkeycdm|,
16     # and produce video frames filled with a solid color instead.
17     'use_fake_video_decoder%': 0,
18     # Set |use_libvpx| to 1 to use libvpx for VP8 decoding in |clearkeycdm|.
19     'use_libvpx%': 0,
20   },
21   'conditions': [
22     ['enable_pepper_cdms==1', {
23         'includes': [
24           '../build/util/version.gypi',
25         ],
26         'targets': [
27         {
28           # GN version: //media/cdm/ppapi:clearkeycdm
29           'target_name': 'clearkeycdm',
30           'type': 'none',
31           # TODO(tomfinegan): Simplify this by unconditionally including all the
32           # decoders, and changing clearkeycdm to select which decoder to use
33           # based on environment variables.
34           'conditions': [
35             ['use_fake_video_decoder == 1' , {
36               'defines': ['CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER'],
37               'sources': [
38                 'cdm/ppapi/external_clear_key/fake_cdm_video_decoder.cc',
39                 'cdm/ppapi/external_clear_key/fake_cdm_video_decoder.h',
40               ],
41             }],
42             ['use_ffmpeg == 1'  , {
43               'defines': ['CLEAR_KEY_CDM_USE_FFMPEG_DECODER'],
44               'dependencies': [
45                 '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
46               ],
47               'sources': [
48                 'cdm/ppapi/external_clear_key/ffmpeg_cdm_audio_decoder.cc',
49                 'cdm/ppapi/external_clear_key/ffmpeg_cdm_audio_decoder.h',
50               ],
51             }],
52             ['use_ffmpeg == 1 and use_fake_video_decoder == 0'  , {
53               'sources': [
54                 'cdm/ppapi/external_clear_key/ffmpeg_cdm_video_decoder.cc',
55                 'cdm/ppapi/external_clear_key/ffmpeg_cdm_video_decoder.h',
56               ],
57             }],
58             ['use_libvpx == 1 and use_fake_video_decoder == 0' , {
59               'defines': ['CLEAR_KEY_CDM_USE_LIBVPX_DECODER'],
60               'dependencies': [
61                 '<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
62               ],
63               'sources': [
64                 'cdm/ppapi/external_clear_key/libvpx_cdm_video_decoder.cc',
65                 'cdm/ppapi/external_clear_key/libvpx_cdm_video_decoder.h',
66               ],
67             }],
68             ['os_posix == 1 and OS != "mac" and enable_pepper_cdms==1', {
69               'type': 'loadable_module',  # Must be in PRODUCT_DIR for ASAN bot.
70             }],
71             ['(OS == "mac" or OS == "win") and enable_pepper_cdms==1', {
72               'type': 'shared_library',
73             }],
74             ['OS == "mac"', {
75               'xcode_settings': {
76                 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
77               },
78             }]
79           ],
80           'defines': ['CDM_IMPLEMENTATION'],
81           'dependencies': [
82             'media',
83             '../url/url.gyp:url_lib',
84             # Include the following for media::AudioBus.
85             'shared_memory_support',
86             '<(DEPTH)/base/base.gyp:base',
87           ],
88           'sources': [
89             'cdm/ppapi/cdm_file_io_test.cc',
90             'cdm/ppapi/cdm_file_io_test.h',
91             'cdm/ppapi/external_clear_key/cdm_video_decoder.cc',
92             'cdm/ppapi/external_clear_key/cdm_video_decoder.h',
93             'cdm/ppapi/external_clear_key/clear_key_cdm.cc',
94             'cdm/ppapi/external_clear_key/clear_key_cdm.h',
95             'cdm/ppapi/external_clear_key/clear_key_cdm_common.h',
96           ],
97           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
98           'msvs_disabled_warnings': [ 4267, ],
99         },
100         {
101           # GN version: //media/cdm/ppapi:clearkeycdmadapter_resources
102           'target_name': 'clearkeycdmadapter_resources',
103           'type': 'none',
104           'conditions': [
105             ['branding == "Chrome"', {
106               'variables': {
107                 'branding_path': '../chrome/app/theme/google_chrome/BRANDING',
108               },
109             }, { # else branding!="Chrome"
110               'variables': {
111                 'branding_path': '../chrome/app/theme/chromium/BRANDING',
112               },
113             }],
114           ],
115           'variables': {
116             'output_dir': '.',
117             'template_input_path': '../chrome/app/chrome_version.rc.version',
118             'extra_variable_files_arguments':
119               [ '-f', 'cdm/ppapi/external_clear_key/BRANDING' ],
120             'extra_variable_files': [ 'cdm/ppapi/external_clear_key/BRANDING' ],
121           },
122           'sources': [
123             'clearkeycdmadapter.ver',
124           ],
125           'includes': [
126             '../chrome/version_resource_rules.gypi',
127           ],
128         },
129         {
130           # GN version: //media/cdm/ppapi:clearkeycdmadapter
131           'target_name': 'clearkeycdmadapter',
132           'type': 'none',
133           # Check whether the plugin's origin URL is valid.
134           'defines': ['CHECK_DOCUMENT_URL'],
135           'dependencies': [
136             '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
137             'media_cdm_adapter.gyp:cdmadapter',
138             'clearkeycdm',
139             'clearkeycdmadapter_resources',
140           ],
141           'sources': [
142             '<(SHARED_INTERMEDIATE_DIR)/clearkeycdmadapter_version.rc',
143           ],
144           'conditions': [
145             ['os_posix == 1 and OS != "mac" and enable_pepper_cdms==1', {
146               # Because clearkeycdm has type 'loadable_module' (see comments),
147               # we must explicitly specify this dependency.
148               'libraries': [
149                '-lrt',
150                 # Built by clearkeycdm.
151                 '<(PRODUCT_DIR)/libclearkeycdm.so',
152               ],
153             }],
154           ],
155         },
156       ],
157     }],
158   ],