Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion xbmc/cores/omxplayer/Makefile.in
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SRCS += OMXAudioCodecOMX.cpp
SRCS += OMXPlayerAudio.cpp SRCS += OMXPlayerAudio.cpp
SRCS += OMXPlayerVideo.cpp SRCS += OMXPlayerVideo.cpp
SRCS += OMXImage.cpp SRCS += OMXImage.cpp
SRCS += BitstreamConverter.cpp


LIB = omxplayer.a LIB = omxplayer.a


Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/omxplayer/OMXImage.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "utils/log.h" #include "utils/log.h"
#include "linux/XMemUtils.h" #include "linux/XMemUtils.h"


#include "BitstreamConverter.h" #include "utils/BitstreamConverter.h"


#include <sys/time.h> #include <sys/time.h>
#include <inttypes.h> #include <inttypes.h>
Expand Down
1 change: 0 additions & 1 deletion xbmc/cores/omxplayer/OMXPlayer.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include "utils/LangCodeExpander.h" #include "utils/LangCodeExpander.h"
#include "guilib/LocalizeStrings.h" #include "guilib/LocalizeStrings.h"


#include "BitstreamConverter.h"
#include "storage/MediaManager.h" #include "storage/MediaManager.h"
#include "GUIUserMessages.h" #include "GUIUserMessages.h"
#include "utils/StreamUtils.h" #include "utils/StreamUtils.h"
Expand Down
2 changes: 1 addition & 1 deletion xbmc/cores/omxplayer/OMXVideo.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


#include <IL/OMX_Video.h> #include <IL/OMX_Video.h>


#include "BitstreamConverter.h" #include "utils/BitstreamConverter.h"


#include "OMXClock.h" #include "OMXClock.h"


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ const int CBitstreamConverter::isom_write_avcc(AVIOContext *pb, const uint8_t *d
if (len > 6) if (len > 6)
{ {
/* check for h264 start code */ /* 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; uint8_t *buf=NULL, *end, *start;
uint32_t sps_size=0, pps_size=0; uint32_t sps_size=0, pps_size=0;
Expand All @@ -367,7 +367,7 @@ const int CBitstreamConverter::isom_write_avcc(AVIOContext *pb, const uint8_t *d
{ {
uint32_t size; uint32_t size;
uint8_t nal_type; uint8_t nal_type;
size = FFMIN(OMX_RB32(buf), end - buf - 4); size = FFMIN(BS_RB32(buf), end - buf - 4);
buf += 4; buf += 4;
nal_type = buf[0] & 0x1f; nal_type = buf[0] & 0x1f;
if (nal_type == 7) /* SPS */ if (nal_type == 7) /* SPS */
Expand Down Expand Up @@ -662,7 +662,7 @@ bool CBitstreamConverter::Convert(uint8_t *pData, int iSize)
uint8_t *nal_start = pData; uint8_t *nal_start = pData;
while (nal_start < end) while (nal_start < end)
{ {
nal_size = OMX_RB24(nal_start); nal_size = BS_RB24(nal_start);
m_dllAvFormat->avio_wb16(pb, nal_size); m_dllAvFormat->avio_wb16(pb, nal_size);
nal_start += 3; nal_start += 3;
m_dllAvFormat->avio_write(pb, nal_start, nal_size); m_dllAvFormat->avio_write(pb, nal_start, nal_size);
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ typedef struct {
// This is part of FFmpeg // This is part of FFmpeg
// * License as published by the Free Software Foundation; either // * License as published by the Free Software Foundation; either
// * version 2.1 of the License, or (at your option) any later version. // * 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))[0] << 8) | \
((const uint8_t*)(x)) [1]) ((const uint8_t*)(x)) [1])


#define OMX_RB24(x) \ #define BS_RB24(x) \
((((const uint8_t*)(x))[0] << 16) | \ ((((const uint8_t*)(x))[0] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \ (((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[2]) ((const uint8_t*)(x))[2])


#define OMX_RB32(x) \ #define BS_RB32(x) \
((((const uint8_t*)(x))[0] << 24) | \ ((((const uint8_t*)(x))[0] << 24) | \
(((const uint8_t*)(x))[1] << 16) | \ (((const uint8_t*)(x))[1] << 16) | \
(((const uint8_t*)(x))[2] << 8) | \ (((const uint8_t*)(x))[2] << 8) | \
((const uint8_t*)(x))[3]) ((const uint8_t*)(x))[3])


#define OMX_WB32(p, d) { \ #define BS_WB32(p, d) { \
((uint8_t*)(p))[3] = (d); \ ((uint8_t*)(p))[3] = (d); \
((uint8_t*)(p))[2] = (d) >> 8; \ ((uint8_t*)(p))[2] = (d) >> 8; \
((uint8_t*)(p))[1] = (d) >> 16; \ ((uint8_t*)(p))[1] = (d) >> 16; \
Expand Down
1 change: 1 addition & 0 deletions xbmc/utils/Makefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ SRCS=AlarmClock.cpp \
Weather.cpp \ Weather.cpp \
XBMCTinyXML.cpp \ XBMCTinyXML.cpp \
XMLUtils.cpp \ XMLUtils.cpp \
BitstreamConverter.cpp \


LIB=utils.a LIB=utils.a


Expand Down