components/desktop/firefox/patches/firefox-40-libstagefright.patch
changeset 5527 611b2d6efdfe
child 6919 7972aae0fb03
equal deleted inserted replaced
5526:570ac9aab8b2 5527:611b2d6efdfe
       
     1 Do not use certain header files. We define bswap_16 ourselves.
       
     2 Do not plan to send upstream.
       
     3 
       
     4 diff --git a/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp b/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp
       
     5 --- a/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp
       
     6 +++ b/media/libstagefright/frameworks/av/media/libstagefright/id3/ID3.cpp
       
     7 @@ -20,17 +20,23 @@
       
     8  #include <utils/Log.h>
       
     9  
       
    10  #include "../include/ID3.h"
       
    11  
       
    12  #include <media/stagefright/foundation/ADebug.h>
       
    13  #include <media/stagefright/DataSource.h>
       
    14  #include <media/stagefright/Utils.h>
       
    15  #include <utils/String8.h>
       
    16 -#include <byteswap.h>
       
    17 +//#include <byteswap.h>
       
    18 +
       
    19 +#ifndef bswap_16
       
    20 +# define bswap_16(p) \
       
    21 +        (((((uint16_t)(p)) & 0x00ff) << 8) | \
       
    22 +          (((uint16_t)(p))           >> 8));
       
    23 +#endif
       
    24  
       
    25  namespace stagefright {
       
    26  
       
    27  static const size_t kMaxMetadataSize = 3 * 1024 * 1024;
       
    28  
       
    29  struct MemorySource : public DataSource {
       
    30      MemorySource(const uint8_t *data, size_t size)
       
    31          : mData(data),
       
    32 diff --git a/media/libstagefright/moz.build b/media/libstagefright/moz.build
       
    33 --- a/media/libstagefright/moz.build
       
    34 +++ b/media/libstagefright/moz.build
       
    35 @@ -2,17 +2,17 @@
       
    36  # vim: set filetype=python:
       
    37  # This Source Code Form is subject to the terms of the Mozilla Public
       
    38  # License, v. 2.0. If a copy of the MPL was not distributed with this
       
    39  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
       
    40  
       
    41  DEFINES['ANDROID_SMP'] = 0
       
    42  DEFINES['LOG_NDEBUG'] = 1
       
    43  
       
    44 -if CONFIG['OS_TARGET'] != 'WINNT':
       
    45 +if CONFIG['OS_TARGET'] != 'WINNT' and CONFIG['OS_TARGET'] != 'SunOS':
       
    46     DEFINES['_GLIBCXX_OS_DEFINES'] = True
       
    47  
       
    48  if CONFIG['OS_TARGET'] == 'WINNT':
       
    49      if CONFIG['_MSC_VER']:
       
    50          DEFINES['ssize_t'] = 'intptr_t'
       
    51          DEFINES['off64_t'] = 'int64_t'
       
    52          DEFINES['strcasecmp'] = 'stricmp'
       
    53          DEFINES['strncasecmp'] = 'strnicmp'
       
    54 diff --git a/media/libstagefright/system/core/include/cutils/properties.h b/media/libstagefright/system/core/include/cutils/properties.h
       
    55 --- a/media/libstagefright/system/core/include/cutils/properties.h
       
    56 +++ b/media/libstagefright/system/core/include/cutils/properties.h
       
    57 @@ -12,17 +12,17 @@
       
    58   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    59   * See the License for the specific language governing permissions and
       
    60   * limitations under the License.
       
    61   */
       
    62  
       
    63  #ifndef __CUTILS_PROPERTIES_H
       
    64  #define __CUTILS_PROPERTIES_H
       
    65  
       
    66 -#include <sys/cdefs.h>
       
    67 +//#include <sys/cdefs.h>
       
    68  #include <stddef.h>
       
    69  
       
    70  #ifdef __cplusplus
       
    71  extern "C" {
       
    72  #endif
       
    73  
       
    74  /* System properties are *small* name value pairs managed by the
       
    75  ** property service.  If your data doesn't fit in the provided