perf
This commit is contained in:
+15
-4
@@ -419,6 +419,7 @@ void MxlSdkFeed::closeFlow()
|
||||
mFlowOpened = false;
|
||||
mFlowInvalid = true;
|
||||
mOpenRetryCount = 0;
|
||||
mV210Payload.clear();
|
||||
}
|
||||
|
||||
const VideoFrame& MxlSdkFeed::getFrame(uint32_t frameCounter)
|
||||
@@ -501,7 +502,17 @@ const VideoFrame& MxlSdkFeed::getFrame(uint32_t frameCounter)
|
||||
|
||||
mLastDisplayedIndex = index;
|
||||
|
||||
mV210Payload = payload;
|
||||
const size_t payloadSize =
|
||||
static_cast<size_t>(mSourceStride) *
|
||||
static_cast<size_t>(mSourceHeight);
|
||||
|
||||
if (payload == nullptr || payloadSize == 0)
|
||||
{
|
||||
return mFrame;
|
||||
}
|
||||
|
||||
mV210Payload.resize(payloadSize);
|
||||
std::memcpy(mV210Payload.data(), payload, payloadSize);
|
||||
++mFrameVersion;
|
||||
|
||||
return mFrame;
|
||||
@@ -509,7 +520,7 @@ const VideoFrame& MxlSdkFeed::getFrame(uint32_t frameCounter)
|
||||
|
||||
FeedRuntimeStatus MxlSdkFeed::status() const
|
||||
{
|
||||
if (mFlowOpened && mV210Payload != nullptr)
|
||||
if (mFlowOpened && !mV210Payload.empty())
|
||||
{
|
||||
return FeedRuntimeStatus::Live;
|
||||
}
|
||||
@@ -603,8 +614,8 @@ float MxlSdkFeed::srcAspectRatio() const
|
||||
return 16.0f / 9.0f;
|
||||
}
|
||||
|
||||
bool MxlSdkFeed::hasV210() const { return mFlowOpened && mV210Payload != nullptr; }
|
||||
const uint8_t* MxlSdkFeed::v210Data() const { return mV210Payload; }
|
||||
bool MxlSdkFeed::hasV210() const { return mFlowOpened && !mV210Payload.empty(); }
|
||||
const uint8_t* MxlSdkFeed::v210Data() const { return mV210Payload.data(); }
|
||||
uint32_t MxlSdkFeed::v210Width() const { return mSourceWidth; }
|
||||
uint32_t MxlSdkFeed::v210Height() const { return mSourceHeight; }
|
||||
uint32_t MxlSdkFeed::v210Stride() const { return mSourceStride; }
|
||||
|
||||
Reference in New Issue
Block a user