本文整理汇总了C++中Encoder::ProcessInput方法的典型用法代码示例。如果您正苦于以下问题:C++ Encoder::ProcessInput方法的具体用法?C++ Encoder::ProcessInput怎么用?C++ Encoder::ProcessInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encoder
的用法示例。
在下文中一共展示了Encoder::ProcessInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MFAAC_Encode
static bool MFAAC_Encode(void *data, struct encoder_frame *frame,
struct encoder_packet *packet, bool *received_packet)
{
Encoder *enc = static_cast<Encoder *>(data);
Status status;
if (!enc->ProcessInput(frame->data[0], frame->linesize[0], frame->pts,
&status))
return false;
// This shouldn't happen since we drain right after
// we process input
if (status == NOT_ACCEPTING)
return false;
UINT8 *outputData;
UINT32 outputDataLength;
UINT64 outputPts;
if (!enc->ProcessOutput(&outputData, &outputDataLength, &outputPts,
&status))
return false;
// Needs more input, not a failure case
if (status == NEED_MORE_INPUT)
return true;
packet->pts = outputPts;
packet->dts = outputPts;
packet->data = outputData;
packet->size = outputDataLength;
packet->type = OBS_ENCODER_AUDIO;
packet->timebase_num = 1;
packet->timebase_den = enc->SampleRate();
return *received_packet = true;
}