MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / pushFrames

Method pushFrames

framework/filter/VideoFilterChain.cpp:118–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void VideoFilterChain::pushFrames(std::unique_ptr<IVideoFilter> &filter, SpscQueue<IAFFrame *> &inputFrames)
119{
120 int ret = 0;
121 std::unique_ptr<IAFFrame> frame = nullptr;
122 while (true) {
123 if (inputFrames.empty()) {
124 //TODO eof
125 break;
126 } else {
127 frame = std::unique_ptr<IAFFrame>(inputFrames.front());
128
129 // AF_LOGD("filter %s push pts = %lld", filter->getName().c_str(), frame->getInfo().pts);
130
131 ret = filter->push(frame, 0);
132 if (ret >= 0) {
133 inputFrames.pop();
134 } else if (ret == -EAGAIN) {
135 // AF_LOGD("filter %s push EAGAIN", filter->getName().c_str());
136 //todo why not eagain
137 break;
138 } else {
139 AF_LOGW("filer %s push Error = %d ", filter->getName().c_str(), ret);
140 inputFrames.pop();
141 break;
142 }
143 }
144 }
145}
146
147int VideoFilterChain::pull(std::unique_ptr<IAFFrame> &frame)
148{

Callers

nothing calls this directly

Calls 5

frontMethod · 0.80
emptyMethod · 0.45
pushMethod · 0.45
popMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected