- add sources.
[platform/framework/web/crosswalk.git] / src / media / media_cdm.gypi
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.
4
5 {
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   'targets': [
22     {
23       'target_name': 'clearkeycdm',
24       'type': 'none',
25       # TODO(tomfinegan): Simplify this by unconditionally including all the
26       # decoders, and changing clearkeycdm to select which decoder to use
27       # based on environment variables.
28       'conditions': [
29         ['use_fake_video_decoder == 1' , {
30           'defines': ['CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER'],
31           'sources': [
32             'cdm/ppapi/fake_cdm_video_decoder.cc',
33             'cdm/ppapi/fake_cdm_video_decoder.h',
34           ],
35         }],
36         ['use_ffmpeg == 1'  , {
37           'defines': ['CLEAR_KEY_CDM_USE_FFMPEG_DECODER'],
38           'dependencies': [
39             '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
40           ],
41           'sources': [
42             'cdm/ppapi/ffmpeg_cdm_audio_decoder.cc',
43             'cdm/ppapi/ffmpeg_cdm_audio_decoder.h',
44           ],
45         }],
46         ['use_ffmpeg == 1 and use_fake_video_decoder == 0'  , {
47           'sources': [
48             'cdm/ppapi/ffmpeg_cdm_video_decoder.cc',
49             'cdm/ppapi/ffmpeg_cdm_video_decoder.h',
50           ],
51         }],
52         ['use_libvpx == 1 and use_fake_video_decoder == 0' , {
53           'defines': ['CLEAR_KEY_CDM_USE_LIBVPX_DECODER'],
54           'dependencies': [
55             '<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
56           ],
57           'sources': [
58             'cdm/ppapi/libvpx_cdm_video_decoder.cc',
59             'cdm/ppapi/libvpx_cdm_video_decoder.h',
60           ],
61         }],
62         ['os_posix == 1 and OS != "mac" and enable_pepper_cdms==1', {
63           'type': 'loadable_module',  # Must be in PRODUCT_DIR for ASAN bots.
64         }],
65         ['(OS == "mac" or OS == "win") and enable_pepper_cdms==1', {
66           'type': 'shared_library',
67         }],
68         ['OS == "mac"', {
69           'xcode_settings': {
70             'DYLIB_INSTALL_NAME_BASE': '@loader_path',
71           },
72         }]
73       ],
74       'defines': ['CDM_IMPLEMENTATION'],
75       'dependencies': [
76         'media',
77         # Include the following for media::AudioBus.
78         'shared_memory_support',
79         '<(DEPTH)/base/base.gyp:base',
80       ],
81       'sources': [
82         'cdm/ppapi/cdm_video_decoder.cc',
83         'cdm/ppapi/cdm_video_decoder.h',
84         'cdm/ppapi/clear_key_cdm.cc',
85         'cdm/ppapi/clear_key_cdm.h',
86         'cdm/ppapi/clear_key_cdm_common.h',
87       ],
88       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
89       'msvs_disabled_warnings': [ 4267, ],
90     },
91     {
92       'target_name': 'clearkeycdmadapter',
93       'type': 'none',
94       # Check whether the plugin's origin URL is valid.
95       'defines': ['CHECK_DOCUMENT_URL'],
96       'dependencies': [
97         '<(DEPTH)/ppapi/ppapi.gyp:ppapi_cpp',
98         'clearkeycdm',
99       ],
100       'sources': [
101         'cdm/ppapi/api/content_decryption_module.h',
102         'cdm/ppapi/cdm_adapter.cc',
103         'cdm/ppapi/cdm_adapter.h',
104         'cdm/ppapi/cdm_helpers.cc',
105         'cdm/ppapi/cdm_helpers.h',
106         'cdm/ppapi/cdm_wrapper.h',
107         'cdm/ppapi/linked_ptr.h',
108         'cdm/ppapi/supported_cdm_versions.h',
109       ],
110       'conditions': [
111         ['os_posix == 1 and OS != "mac" and enable_pepper_cdms==1', {
112           'cflags': ['-fvisibility=hidden'],
113           'type': 'loadable_module',
114           # Allow the plugin adapter to find the CDM in the same directory.
115           'ldflags': ['-Wl,-rpath=\$$ORIGIN'],
116           'libraries': [
117             # Built by clearkeycdm.
118             '<(PRODUCT_DIR)/libclearkeycdm.so',
119           ],
120         }],
121         ['OS == "win" and enable_pepper_cdms==1', {
122           'type': 'shared_library',
123           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
124           'msvs_disabled_warnings': [ 4267, ],
125         }],
126         ['OS == "mac" and enable_pepper_cdms==1', {
127           'type': 'loadable_module',
128           'product_extension': 'plugin',
129           'xcode_settings': {
130             'OTHER_LDFLAGS': [
131               # Not to strip important symbols by -Wl,-dead_strip.
132               '-Wl,-exported_symbol,_PPP_GetInterface',
133               '-Wl,-exported_symbol,_PPP_InitializeModule',
134               '-Wl,-exported_symbol,_PPP_ShutdownModule'
135             ],
136             'DYLIB_INSTALL_NAME_BASE': '@loader_path',
137           },
138         }],
139       ],
140     }
141   ],
142 }