Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdr428 committed Aug 11, 2023
1 parent 1dedebd commit 37f4eb5
Show file tree
Hide file tree
Showing 17 changed files with 174 additions and 205 deletions.
1 change: 1 addition & 0 deletions tsMuxer/avPacket.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct AVPacket
codecID(0)
{
}

int64_t pts; // presentation time stamp in time_base units
int64_t dts; // decompression time stamp in time_base units
uint8_t* data;
Expand Down
2 changes: 1 addition & 1 deletion tsMuxer/combinedH264Demuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void CombinedH264Reader::fillPids(const PIDSet& acceptedPIDs, const int pid)

// --------------------------------------------- CombinedH264Demuxer ---------------------------

CombinedH264Demuxer::CombinedH264Demuxer(BufferedReaderManager& readManager, const char* streamName)
CombinedH264Demuxer::CombinedH264Demuxer(const BufferedReaderManager& readManager, const char* streamName)
: m_readManager(readManager)
{
m_bufferedReader = m_readManager.getReader(streamName);
Expand Down
2 changes: 1 addition & 1 deletion tsMuxer/combinedH264Demuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CombinedH264Reader
class CombinedH264Demuxer : public AbstractDemuxer, public CombinedH264Reader
{
public:
CombinedH264Demuxer(BufferedReaderManager& readManager, const char* streamName);
CombinedH264Demuxer(const BufferedReaderManager& readManager, const char* streamName);
~CombinedH264Demuxer() override;
void openFile(const std::string& streamName) override;
void readClose() override;
Expand Down
2 changes: 1 addition & 1 deletion tsMuxer/h264StreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ int H264StreamReader::calcPicOrder(const SliceUnit &slice)
return (PicOrderCntMsb + PicOrderCntLsb) >> m_forceLsbDiv;
}

int H264StreamReader::getIdrPrevFrames(uint8_t *buff, uint8_t *bufEnd)
int H264StreamReader::getIdrPrevFrames(uint8_t *buff, const uint8_t *bufEnd)
{
int prevPicCnt = 0;
int deserializeRez;
Expand Down
2 changes: 1 addition & 1 deletion tsMuxer/h264StreamReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class H264StreamReader : public MPEGStreamReader

void additionalStreamCheck(uint8_t* buff, uint8_t* end);
int calcPicOrder(const SliceUnit& slice);
int getIdrPrevFrames(uint8_t* buff, uint8_t* bufEnd);
int getIdrPrevFrames(uint8_t* buff, const uint8_t* bufEnd);
int processSliceNal(uint8_t* buff);
int processSPS(uint8_t* buff);
int processPPS(uint8_t* buff);
Expand Down
12 changes: 6 additions & 6 deletions tsMuxer/ioContextDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ float av_int2flt(const uint32_t v)
return ldexp(static_cast<float>((v & 0x7FFFFF) + (1 << 23)) * (v >> 31 | 1), (v >> 23 & 0xFF) - 150);
}

IOContextDemuxer::IOContextDemuxer(BufferedReaderManager& readManager)
IOContextDemuxer::IOContextDemuxer(const BufferedReaderManager& readManager)
: tracks(), m_readManager(readManager), m_lastReadRez(0)
{
m_lastProcessedBytes = 0;
Expand Down Expand Up @@ -90,7 +90,7 @@ int64_t IOContextDemuxer::get_be64()
return val;
}

bool IOContextDemuxer::url_fseek(const uint64_t offset)
bool IOContextDemuxer::url_fseek(const int64_t offset)
{
m_curPos = m_bufEnd = nullptr;
m_isEOF = false;
Expand Down Expand Up @@ -133,14 +133,14 @@ unsigned IOContextDemuxer::get_buffer(uint8_t* binary, unsigned size)
return static_cast<uint32_t>(dst - binary);
}

void IOContextDemuxer::skip_bytes(const uint64_t size)
void IOContextDemuxer::skip_bytes(const int64_t size)
{
uint32_t readedBytes = 0;
int readRez = 0;
uint64_t skipLeft = size;
int64_t skipLeft = size;
if (m_curPos < m_bufEnd)
{
const uint64_t copyLen = min((uint64_t)(m_bufEnd - m_curPos), skipLeft);
const int64_t copyLen = min(m_bufEnd - m_curPos, skipLeft);
skipLeft -= copyLen;
m_curPos += copyLen;
m_processedBytes += copyLen;
Expand All @@ -152,7 +152,7 @@ void IOContextDemuxer::skip_bytes(const uint64_t size)
m_bufferedReader->notify(m_readerID, readedBytes);
m_curPos = data + 188;
m_bufEnd = m_curPos + readedBytes;
const uint64_t copyLen = min((uint64_t)(m_bufEnd - m_curPos), skipLeft);
const int64_t copyLen = min(m_bufEnd - m_curPos, skipLeft);
m_curPos += copyLen;
m_processedBytes += copyLen;
skipLeft -= copyLen;
Expand Down
9 changes: 5 additions & 4 deletions tsMuxer/ioContextDemuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ struct Track
type = IOContextTrackType::UNDEFINED;
}

virtual ~Track()
~Track()
{
delete[] name;
delete[] codec_id;
delete[] codec_name;
delete parsed_priv_data;
}

IOContextTrackType type;
/* Unique track number and track ID. stream_index is the index that
* the calling app uses for this track. */
Expand Down Expand Up @@ -87,7 +88,7 @@ struct Track
class IOContextDemuxer : public AbstractDemuxer
{
public:
IOContextDemuxer(BufferedReaderManager& readManager);
IOContextDemuxer(const BufferedReaderManager& readManager);
~IOContextDemuxer() override;
void setFileIterator(FileNameIterator* itr) override;
uint64_t getDemuxedSize() override;
Expand All @@ -109,9 +110,9 @@ class IOContextDemuxer : public AbstractDemuxer
int64_t m_processedBytes;
int64_t m_lastProcessedBytes;

void skip_bytes(uint64_t size);
void skip_bytes(int64_t size);
unsigned get_buffer(uint8_t* binary, unsigned size);
bool url_fseek(uint64_t offset);
bool url_fseek(int64_t offset);
int64_t get_be64();
unsigned int get_be32();
int get_be16();
Expand Down
2 changes: 1 addition & 1 deletion tsMuxer/iso_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ void IsoWriter::writeAllocationExtentDescriptor(const ExtentList *extents, const

int IsoWriter::writeExtendedFileEntryDescriptor(const bool namedStream, const uint8_t objectId,
const FileTypes fileType, const uint64_t len, const uint32_t pos,
const uint16_t linkCount, ExtentList *extents)
const uint16_t linkCount, const ExtentList *extents)
{
int sectorsWrited = 0;

Expand Down
6 changes: 3 additions & 3 deletions tsMuxer/iso_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class IsoWriter
void writeTerminationDescriptor();
void writeLogicalVolumeIntegrityDescriptor();
int writeExtendedFileEntryDescriptor(bool namedStream, uint8_t objectId, FileTypes fileType, uint64_t len,
uint32_t pos, uint16_t linkCount, ExtentList* extents = 0);
uint32_t pos, uint16_t linkCount, const ExtentList* extents = nullptr);
void writeFileSetDescriptor();
void writeAllocationExtentDescriptor(const ExtentList* extents, size_t start, size_t indexEnd);
// void writeFileIdentifierDescriptor();
Expand All @@ -232,7 +232,7 @@ class IsoWriter
void allocateMetadata();
void writeMetadata(int lbn);

FileEntryInfo* mkdir(const char* name, FileEntryInfo* parent = 0);
FileEntryInfo* mkdir(const char* name, FileEntryInfo* parent = nullptr);
FileEntryInfo* getEntryByName(const std::string& name, FileTypes fileType);
FileEntryInfo* createFileEntry(FileEntryInfo* parent, FileTypes fileType);

Expand Down Expand Up @@ -278,7 +278,7 @@ class IsoWriter
class ISOFile : public AbstractOutputStream
{
public:
ISOFile(IsoWriter* owner) : AbstractOutputStream(), m_owner(owner), m_entry(0) {}
ISOFile(IsoWriter* owner) : AbstractOutputStream(), m_owner(owner), m_entry(nullptr) {}
~ISOFile() override { close(); }

int write(const void* data, uint32_t len) override;
Expand Down
Loading

0 comments on commit 37f4eb5

Please sign in to comment.