Skip to content

Commit

Permalink
Linuxビルドを修正。
Browse files Browse the repository at this point in the history
  • Loading branch information
rigaya committed Oct 18, 2023
1 parent fd35387 commit 6c2e67e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NVEncCore/rgy_avutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,15 @@ uniuqeRGYChannelLayout getDefaultChannelLayout(const int nb_channels) {
return ch_layout;
}

int getChannelLayoutIndexFromChannel(const RGYChannelLayout *ch_layout, const AVChannel channel) {
int getChannelLayoutIndexFromChannel(const RGYChannelLayout *ch_layout, const RGYChannel channel) {
#if AV_CHANNEL_LAYOUT_STRUCT_AVAIL
return av_channel_layout_index_from_channel(ch_layout, channel);
#else
return av_get_channel_layout_channel_index(*ch_layout, (int)channel);
#endif
}

AVChannel getChannelLayoutChannelFromIndex(const RGYChannelLayout *ch_layout, const int index) {
RGYChannel getChannelLayoutChannelFromIndex(const RGYChannelLayout *ch_layout, const int index) {
#if AV_CHANNEL_LAYOUT_STRUCT_AVAIL
return av_channel_layout_channel_from_index(ch_layout, index);
#else
Expand Down
6 changes: 4 additions & 2 deletions NVEncCore/rgy_avutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ extern "C" {
#endif

#if AV_CHANNEL_LAYOUT_STRUCT_AVAIL
using RGYChannel = AVChannel;
using RGYChannelLayout = AVChannelLayout;
using uniuqeRGYChannelLayout = std::unique_ptr<RGYChannelLayout, decltype(&av_channel_layout_uninit)>;
#else
using RGYChannel = uint64_t;
using RGYChannelLayout = uint64_t;
using uniuqeRGYChannelLayout = std::unique_ptr<RGYChannelLayout>;
#endif
Expand Down Expand Up @@ -376,8 +378,8 @@ uniuqeRGYChannelLayout getChannelLayoutFromString(const std::string& channel_lay
//デフォルトのチャンネルレイアウトを取得
uniuqeRGYChannelLayout getDefaultChannelLayout(const int nb_channels);

int getChannelLayoutIndexFromChannel(const RGYChannelLayout *ch_layout, const AVChannel channel);
AVChannel getChannelLayoutChannelFromIndex(const RGYChannelLayout *ch_layout, const int index);
int getChannelLayoutIndexFromChannel(const RGYChannelLayout *ch_layout, const RGYChannel channel);
RGYChannel getChannelLayoutChannelFromIndex(const RGYChannelLayout *ch_layout, const int index);

//時刻を表示
std::string getTimestampChar(int64_t ts, const AVRational& timebase);
Expand Down

0 comments on commit 6c2e67e

Please sign in to comment.