Skip to content

Commit d9182ff

Browse files
committed
omt: Move video_desc_from_omt_frame to common header
1 parent 5fc17db commit d9182ff

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/omt_common.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,13 @@ void omt_frame_set_data(OMTMediaFrame& f, const video_frame& ug_frame){
8181
f.DataLength = ug_frame.tiles[0].data_len;
8282
}
8383

84+
video_desc video_desc_from_omt_frame(const OMTMediaFrame *omt_frame){
85+
video_desc incoming_desc{};
86+
incoming_desc.fps = static_cast<double>(omt_frame->FrameRateN) / omt_frame->FrameRateD;
87+
incoming_desc.width = omt_frame->Width;
88+
incoming_desc.height = omt_frame->Height;
89+
incoming_desc.color_spec = UYVY; assert(omt_frame->Codec == OMTCodec_UYVY); //TODO
90+
incoming_desc.tile_count = 1;
91+
return incoming_desc;
92+
}
93+

src/omt_common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,6 @@ void omt_log_callback(const char *msg);
5151
void set_omt_sender_info(omt_send_t *send_handle);
5252
bool omt_frame_init_from_desc(OMTMediaFrame& f, const video_desc& frame_desc);
5353
void omt_frame_set_data(OMTMediaFrame& f, const video_frame& ug_frame);
54+
video_desc video_desc_from_omt_frame(const OMTMediaFrame *omt_frame);
5455

5556
#endif //OMT_COMMON_HPP_5963748ABF904BA79B6C22CAC8500636

src/video_rxtx/omt.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,6 @@ void omt_rxtx_send_frame(void *state, std::shared_ptr<video_frame> f){
168168
omt_send(s->omt_send_handle.get(), &s->send_video_frame);
169169
}
170170

171-
video_desc video_desc_from_omt_frame(const OMTMediaFrame *omt_frame){
172-
video_desc incoming_desc{};
173-
incoming_desc.fps = static_cast<double>(omt_frame->FrameRateN) / omt_frame->FrameRateD;
174-
incoming_desc.width = omt_frame->Width;
175-
incoming_desc.height = omt_frame->Height;
176-
incoming_desc.color_spec = UYVY; assert(omt_frame->Codec == OMTCodec_UYVY); //TODO
177-
incoming_desc.tile_count = 1;
178-
return incoming_desc;
179-
}
180-
181171
void *omt_rxtx_recv_worker(void *state){
182172
auto s = static_cast<omt_rxtx_state *>(state);
183173
register_should_exit_callback(s->parent, omt_should_exit_callback, s);

0 commit comments

Comments
 (0)