Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[rbp/linux] changed move BitstreamConverter to a common location #1473

Merged
merged 3 commits into from Sep 27, 2012
@@ -7,7 +7,6 @@ SRCS += OMXAudioCodecOMX.cpp
SRCS += OMXPlayerAudio.cpp
SRCS += OMXPlayerVideo.cpp
SRCS += OMXImage.cpp
-SRCS += BitstreamConverter.cpp
LIB = omxplayer.a
@@ -29,7 +29,7 @@
#include "utils/log.h"
#include "linux/XMemUtils.h"
-#include "BitstreamConverter.h"
+#include "utils/BitstreamConverter.h"
#include <sys/time.h>
#include <inttypes.h>
@@ -53,7 +53,6 @@
#include "utils/LangCodeExpander.h"
#include "guilib/LocalizeStrings.h"
-#include "BitstreamConverter.h"
#include "storage/MediaManager.h"
#include "GUIUserMessages.h"
#include "utils/StreamUtils.h"
@@ -26,7 +26,7 @@
#include <IL/OMX_Video.h>
-#include "BitstreamConverter.h"
+#include "utils/BitstreamConverter.h"
#include "OMXClock.h"
@@ -350,7 +350,7 @@ const int CBitstreamConverter::isom_write_avcc(AVIOContext *pb, const uint8_t *d
if (len > 6)
{
/* check for h264 start code */
- if (OMX_RB32(data) == 0x00000001 || OMX_RB24(data) == 0x000001)
+ if (BS_RB32(data) == 0x00000001 || BS_RB24(data) == 0x000001)
{
uint8_t *buf=NULL, *end, *start;
uint32_t sps_size=0, pps_size=0;
@@ -367,7 +367,7 @@ const int CBitstreamConverter::isom_write_avcc(AVIOContext *pb, const uint8_t *d
{
uint32_t size;
uint8_t nal_type;
- size = FFMIN(OMX_RB32(buf), end - buf - 4);
+ size = FFMIN(BS_RB32(buf), end - buf - 4);
buf += 4;
nal_type = buf[0] & 0x1f;
if (nal_type == 7) /* SPS */
@@ -662,7 +662,7 @@ bool CBitstreamConverter::Convert(uint8_t *pData, int iSize)
uint8_t *nal_start = pData;
while (nal_start < end)
{
- nal_size = OMX_RB24(nal_start);
+ nal_size = BS_RB24(nal_start);
m_dllAvFormat->avio_wb16(pb, nal_size);
nal_start += 3;
m_dllAvFormat->avio_write(pb, nal_start, nal_size);
@@ -40,22 +40,22 @@ typedef struct {
// This is part of FFmpeg
// * License as published by the Free Software Foundation; either
// * version 2.1 of the License, or (at your option) any later version.
-#define OMX_RB16(x) \
+#define BS_RB16(x) \
((((const uint8_t*)(x))[0] << 8) | \
((const uint8_t*)(x)) [1])
-#define OMX_RB24(x) \
+#define BS_RB24(x) \
((((const uint8_t*)(x))[0] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[2])
-#define OMX_RB32(x) \
+#define BS_RB32(x) \
((((const uint8_t*)(x))[0] << 24) | \
(((const uint8_t*)(x))[1] << 16) | \
(((const uint8_t*)(x))[2] << 8) | \
((const uint8_t*)(x))[3])
-#define OMX_WB32(p, d) { \
+#define BS_WB32(p, d) { \
((uint8_t*)(p))[3] = (d); \
((uint8_t*)(p))[2] = (d) >> 8; \
((uint8_t*)(p))[1] = (d) >> 16; \
View
@@ -66,6 +66,7 @@ SRCS=AlarmClock.cpp \
Weather.cpp \
XBMCTinyXML.cpp \
XMLUtils.cpp \
+ BitstreamConverter.cpp \
LIB=utils.a