mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 11:51:57 +00:00
rename SrsBitStream to SrsBitBuffer
This commit is contained in:
parent
0e52fc6d5b
commit
dadfe101b4
5 changed files with 14 additions and 14 deletions
|
@ -252,30 +252,30 @@ void SrsBuffer::write_bytes(char* data, int size)
|
|||
p += size;
|
||||
}
|
||||
|
||||
SrsBitStream::SrsBitStream()
|
||||
SrsBitBuffer::SrsBitBuffer()
|
||||
{
|
||||
cb = 0;
|
||||
cb_left = 0;
|
||||
stream = NULL;
|
||||
}
|
||||
|
||||
SrsBitStream::~SrsBitStream()
|
||||
SrsBitBuffer::~SrsBitBuffer()
|
||||
{
|
||||
}
|
||||
|
||||
int SrsBitStream::initialize(SrsBuffer* s) {
|
||||
int SrsBitBuffer::initialize(SrsBuffer* s) {
|
||||
stream = s;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
bool SrsBitStream::empty() {
|
||||
bool SrsBitBuffer::empty() {
|
||||
if (cb_left) {
|
||||
return false;
|
||||
}
|
||||
return stream->empty();
|
||||
}
|
||||
|
||||
int8_t SrsBitStream::read_bit() {
|
||||
int8_t SrsBitBuffer::read_bit() {
|
||||
if (!cb_left) {
|
||||
srs_assert(!stream->empty());
|
||||
cb = stream->read_1bytes();
|
||||
|
|
|
@ -159,15 +159,15 @@ public:
|
|||
/**
|
||||
* the bit stream.
|
||||
*/
|
||||
class SrsBitStream
|
||||
class SrsBitBuffer
|
||||
{
|
||||
private:
|
||||
int8_t cb;
|
||||
u_int8_t cb_left;
|
||||
SrsBuffer* stream;
|
||||
public:
|
||||
SrsBitStream();
|
||||
virtual ~SrsBitStream();
|
||||
SrsBitBuffer();
|
||||
virtual ~SrsBitBuffer();
|
||||
public:
|
||||
virtual int initialize(SrsBuffer* s);
|
||||
virtual bool empty();
|
||||
|
|
|
@ -981,7 +981,7 @@ int SrsAvcAacCodec::avc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
|
|||
return ret;
|
||||
}
|
||||
|
||||
SrsBitStream bs;
|
||||
SrsBitBuffer bs;
|
||||
if ((ret = bs.initialize(&stream)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ using namespace std;
|
|||
// @see SRS_SYS_TIME_RESOLUTION_MS_TIMES
|
||||
#define SYS_TIME_RESOLUTION_US 300*1000
|
||||
|
||||
int srs_avc_nalu_read_uev(SrsBitStream* stream, int32_t& v)
|
||||
int srs_avc_nalu_read_uev(SrsBitBuffer* stream, int32_t& v)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
@ -82,7 +82,7 @@ int srs_avc_nalu_read_uev(SrsBitStream* stream, int32_t& v)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int srs_avc_nalu_read_bit(SrsBitStream* stream, int8_t& v)
|
||||
int srs_avc_nalu_read_bit(SrsBitBuffer* stream, int8_t& v)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
|
|
@ -34,15 +34,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <vector>
|
||||
|
||||
class SrsBuffer;
|
||||
class SrsBitStream;
|
||||
class SrsBitBuffer;
|
||||
|
||||
// compare
|
||||
#define srs_min(a, b) (((a) < (b))? (a) : (b))
|
||||
#define srs_max(a, b) (((a) < (b))? (b) : (a))
|
||||
|
||||
// read nalu uev.
|
||||
extern int srs_avc_nalu_read_uev(SrsBitStream* stream, int32_t& v);
|
||||
extern int srs_avc_nalu_read_bit(SrsBitStream* stream, int8_t& v);
|
||||
extern int srs_avc_nalu_read_uev(SrsBitBuffer* stream, int32_t& v);
|
||||
extern int srs_avc_nalu_read_bit(SrsBitBuffer* stream, int8_t& v);
|
||||
|
||||
// get current system time in ms, use cache to avoid performance problem
|
||||
extern int64_t srs_get_system_time_ms();
|
||||
|
|
Loading…
Reference in a new issue