MCPcopy Create free account
hub / github.com/IENT/YUView / pushData

Method pushData

YUViewLib/src/decoder/decoderHM.cpp:312–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312bool decoderHM::pushData(QByteArray &data)
313{
314 if (decoderState != DecoderState::NeedsMoreData)
315 {
316 DEBUG_DECHM("decoderHM::pushData: Wrong decoder state.");
317 return false;
318 }
319
320 bool endOfFile = (data.length() == 0);
321 if (endOfFile)
322 DEBUG_DECHM("decoderFFmpeg::pushData: Received empty packet. Setting EOF.");
323
324 // Push the data of the NAL unit. The function libHMDec_push_nal_unit can handle data
325 // with a start code and without.
326 bool checkOutputPictures = false;
327 bool bNewPicture = false;
328 auto err = this->lib.libHMDec_push_nal_unit(
329 decoder, data, data.length(), endOfFile, bNewPicture, checkOutputPictures);
330 if (err != LIBHMDEC_OK)
331 return setErrorB(QString("Error pushing data to decoder (libHMDec_push_nal_unit) length %1")
332 .arg(data.length()));
333 DEBUG_DECHM("decoderHM::pushData pushed NAL length %d%s%s",
334 data.length(),
335 bNewPicture ? " bNewPicture" : "",
336 checkOutputPictures ? " checkOutputPictures" : "");
337
338 if (checkOutputPictures && getNextFrameFromDecoder())
339 {
340 decodedFrameWaiting = true;
341 decoderState = DecoderState::RetrieveFrames;
342 currentOutputBuffer.clear();
343 }
344
345 // If bNewPicture is true, the decoder noticed that a new picture starts with this
346 // NAL unit and decoded what it already has (in the original decoder, the bitstream will
347 // be rewound). The decoder expects us to push the data again.
348 return !bNewPicture;
349}
350
351QByteArray decoderHM::getRawFrameData()
352{

Callers 2

loadRawDataMethod · 0.45
seekToPositionMethod · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected