2019-03-02 22:16:55 +08:00
|
|
|
#include "video_buffer.h"
|
|
|
|
|
2019-11-28 04:11:40 +08:00
|
|
|
#include <assert.h>
|
2019-03-02 22:16:55 +08:00
|
|
|
#include <libavutil/avutil.h>
|
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
|
2019-11-24 18:53:00 +08:00
|
|
|
#include "util/log.h"
|
2019-03-02 22:16:55 +08:00
|
|
|
|
2019-03-03 06:52:22 +08:00
|
|
|
bool
|
2021-06-26 21:02:18 +08:00
|
|
|
sc_video_buffer_init(struct sc_video_buffer *vb) {
|
2021-07-04 18:39:03 +08:00
|
|
|
return sc_frame_buffer_init(&vb->fb);
|
2019-03-02 22:16:55 +08:00
|
|
|
}
|
|
|
|
|
2019-03-03 03:09:56 +08:00
|
|
|
void
|
2021-06-26 21:02:18 +08:00
|
|
|
sc_video_buffer_destroy(struct sc_video_buffer *vb) {
|
2021-07-04 18:39:03 +08:00
|
|
|
sc_frame_buffer_destroy(&vb->fb);
|
2019-03-02 22:16:55 +08:00
|
|
|
}
|
|
|
|
|
2021-04-11 21:01:05 +08:00
|
|
|
bool
|
2021-06-26 21:02:18 +08:00
|
|
|
sc_video_buffer_push(struct sc_video_buffer *vb, const AVFrame *frame,
|
2021-04-11 21:01:05 +08:00
|
|
|
bool *previous_frame_skipped) {
|
2021-07-04 18:39:03 +08:00
|
|
|
return sc_frame_buffer_push(&vb->fb, frame, previous_frame_skipped);
|
2019-03-02 22:16:55 +08:00
|
|
|
}
|
|
|
|
|
2021-04-11 21:01:05 +08:00
|
|
|
void
|
2021-06-26 21:02:18 +08:00
|
|
|
sc_video_buffer_consume(struct sc_video_buffer *vb, AVFrame *dst) {
|
2021-07-04 18:39:03 +08:00
|
|
|
sc_frame_buffer_consume(&vb->fb, dst);
|
2019-03-02 22:16:55 +08:00
|
|
|
}
|