File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
src/AvTranscoder/data/decoded Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -80,4 +80,18 @@ void Frame::allocateAVFrame()
80
80
throw std::runtime_error (" Unable to allocate an empty Frame." );
81
81
}
82
82
}
83
+
84
+ bool Frame::isAudioFrame () const
85
+ {
86
+ if (_frame->sample_rate && _frame->channels && _frame->channel_layout && _frame->format != -1 )
87
+ return true ;
88
+ return false ;
89
+ }
90
+
91
+ bool Frame::isVideoFrame () const
92
+ {
93
+ if (_frame->width && _frame->height && _frame->format != -1 )
94
+ return true ;
95
+ return false ;
96
+ }
83
97
}
Original file line number Diff line number Diff line change @@ -63,6 +63,18 @@ class AvExport Frame
63
63
*/
64
64
void clear ();
65
65
66
+ /* *
67
+ * @return If it corresponds to a valid audio frame.
68
+ * @see AudioFrame
69
+ */
70
+ bool isAudioFrame () const ;
71
+
72
+ /* *
73
+ * @return If it corresponds to a valid video frame.
74
+ * @see VideoFrame
75
+ */
76
+ bool isVideoFrame () const ;
77
+
66
78
#ifndef SWIG
67
79
AVFrame& getAVFrame () { return *_frame; }
68
80
const AVFrame& getAVFrame () const { return *_frame; }
You can’t perform that action at this time.
0 commit comments