summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/moz.build
blob: 87e16211203c3fe163094ea81bf3b0950483ec6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

DEFINES['ANDROID_SMP'] = 0
DEFINES['LOG_NDEBUG'] = 1

if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['OS_TARGET'] != 'SunOS':
   DEFINES['_GLIBCXX_OS_DEFINES'] = True

if CONFIG['OS_TARGET'] == 'WINNT':
    if CONFIG['_MSC_VER']:
        DEFINES['ssize_t'] = 'intptr_t'
        DEFINES['off64_t'] = 'int64_t'
        DEFINES['strcasecmp'] = 'stricmp'
        DEFINES['strncasecmp'] = 'strnicmp'
    DEFINES['HAVE_MS_C_RUNTIME'] = True
    DEFINES['__PRETTY_FUNCTION__'] = '__FUNCTION__'
    LOCAL_INCLUDES += [ 'ports/win32/include' ]
elif CONFIG['OS_TARGET'] == 'Darwin':
    DEFINES['HAVE_SYS_UIO_H'] = True
    DEFINES['off64_t'] = 'off_t'
    LOCAL_INCLUDES += [ 'ports/darwin/include' ]
elif CONFIG['OS_TARGET'] in ('DragonFly', 'FreeBSD', 'OpenBSD', 'NetBSD',
        'GNU/kFreeBSD'):
    if CONFIG['OS_TARGET'] != 'NetBSD':
        DEFINES['ENODATA'] = '-0x80000003'
    if CONFIG['OS_TARGET'] == 'OpenBSD':
        DEFINES['EBADMSG'] = '-0x80000006'
    DEFINES['HAVE_SYS_UIO_H'] = True
    if CONFIG['OS_TARGET'] != 'GNU/kFreeBSD':
        DEFINES['off64_t'] = 'off_t'
        LOCAL_INCLUDES += [ 'ports/bsd/include' ]
else:
    DEFINES['HAVE_SYS_UIO_H'] = True

if CONFIG['OS_TARGET'] != 'Android':
    DEFINES['FAKE_LOG_DEVICE'] = True
    SOURCES += [
        'system/core/liblog/fake_log_device.c',
    ]
    UNIFIED_SOURCES += [
        'system/core/libcutils/strdup16to8.c',
        'system/core/liblog/logd_write.c',
        'system/core/liblog/logprint.c',
    ]

EXPORTS.mp4_demuxer += [
    'binding/include/mp4_demuxer/Adts.h',
    'binding/include/mp4_demuxer/AnnexB.h',
    'binding/include/mp4_demuxer/Atom.h',
    'binding/include/mp4_demuxer/AtomType.h',
    'binding/include/mp4_demuxer/BitReader.h',
    'binding/include/mp4_demuxer/BufferReader.h',
    'binding/include/mp4_demuxer/BufferStream.h',
    'binding/include/mp4_demuxer/ByteReader.h',
    'binding/include/mp4_demuxer/ByteWriter.h',
    'binding/include/mp4_demuxer/DecoderData.h',
    'binding/include/mp4_demuxer/H264.h',
    'binding/include/mp4_demuxer/Index.h',
    'binding/include/mp4_demuxer/Interval.h',
    'binding/include/mp4_demuxer/MoofParser.h',
    'binding/include/mp4_demuxer/MP4Metadata.h',
    'binding/include/mp4_demuxer/ResourceStream.h',
    'binding/include/mp4_demuxer/SinfParser.h',
    'binding/include/mp4_demuxer/Stream.h',
]

EXPORTS.demuxer += [
    'binding/include/demuxer/TrackDemuxer.h',
]

SOURCES += [
    'frameworks/av/media/libstagefright/foundation/hexdump.cpp',
    'frameworks/av/media/libstagefright/MetaData.cpp',
    'system/core/libutils/RefBase.cpp',
    'system/core/libutils/String16.cpp',
    'system/core/libutils/String8.cpp',
    'system/core/libutils/VectorImpl.cpp',
]

UNIFIED_SOURCES += [
    'binding/Adts.cpp',
    'binding/AnnexB.cpp',
    'binding/BitReader.cpp',
    'binding/Box.cpp',
    'binding/BufferStream.cpp',
    'binding/DecoderData.cpp',
    'binding/H264.cpp',
    'binding/Index.cpp',
    'binding/MoofParser.cpp',
    'binding/MP4Metadata.cpp',
    'binding/ResourceStream.cpp',
    'binding/SinfParser.cpp',
    'frameworks/av/media/libstagefright/DataSource.cpp',
    'frameworks/av/media/libstagefright/ESDS.cpp',
    'frameworks/av/media/libstagefright/foundation/AAtomizer.cpp',
    'frameworks/av/media/libstagefright/foundation/ABitReader.cpp',
    'frameworks/av/media/libstagefright/foundation/ABuffer.cpp',
    'frameworks/av/media/libstagefright/foundation/AString.cpp',
    'frameworks/av/media/libstagefright/MediaBuffer.cpp',
    'frameworks/av/media/libstagefright/MediaDefs.cpp',
    'frameworks/av/media/libstagefright/MediaSource.cpp',
    'frameworks/av/media/libstagefright/MPEG4Extractor.cpp',
    'frameworks/av/media/libstagefright/SampleIterator.cpp',
    'frameworks/av/media/libstagefright/SampleTable.cpp',
    'frameworks/av/media/libstagefright/Utils.cpp',
    'system/core/libutils/SharedBuffer.cpp',
    'system/core/libutils/Static.cpp',
    'system/core/libutils/Unicode.cpp',
]

LOCAL_INCLUDES += [
    'binding/include',
    'frameworks/av/include',
    'frameworks/av/include/media/stagefright/foundation',
    'frameworks/av/media/libstagefright/',
    'stubs/empty',
    'stubs/include',
    'stubs/include/media/stagefright/foundation',
    'system/core/include',
]

TEST_DIRS += [
    'gtest',
]

# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True

FINAL_LIBRARY = 'xul'

# Suppress warnings in third-party code.
if CONFIG['_MSC_VER']:
    CFLAGS += [
        '-wd4013', # 'function' undefined; assuming extern returning int
        '-wd4101', # unreferenced local variable
    ]
    CXXFLAGS += [
        '-wd4018', # '<' : signed/unsigned mismatch
        '-wd4275', # non dll-interface class used as base for dll-interface class
        '-wd4305', # '=' : truncation from 'double' to 'float'
        '-wd4309', # '=' : truncation of constant value
        '-wd4355', # 'this' : used in base member initializer list
        '-wd4804', # '>' : unsafe use of type 'bool' in operation
        '-wd4099', # mismatched class/struct tags
    ]
elif CONFIG['GNU_CXX']:
    CFLAGS += [
        '-Wno-comment',
        '-Wno-sign-compare'
    ]
    CXXFLAGS += [
        '-Wno-format',
        '-Wno-format-security',
        '-Wno-multichar',
        '-Wno-sign-compare',
        '-Wno-unused',
    ]
    if CONFIG['CLANG_CXX']:
        CXXFLAGS += [
            '-Wno-mismatched-tags',
            '-Wno-tautological-constant-out-of-range-compare',
            '-Wno-unreachable-code-return',
            '-Wno-implicit-fallthrough',
        ]