Skip to content

Commit

Permalink
Update LAVFilters IMediaSideData.h link to be more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
CrendKing committed Nov 14, 2023
1 parent 9853ca9 commit 4d1c211
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
17 changes: 9 additions & 8 deletions avisynth_filter/src/frame_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,15 @@ auto FrameHandler::AddInputSample(IMediaSample *inputSample) -> HRESULT {
AVSF_AVS_API->propSetInt(frameProps, "_Transfer", _filter._inputVideoFormat.colorSpaceInfo.transfer, PROPAPPENDMODE_REPLACE);

const DWORD typeSpecificFlags = _filter.m_pInput->SampleProps()->dwTypeSpecificFlags;
int rfpFieldBased;
if (typeSpecificFlags & AM_VIDEO_FLAG_WEAVE) {
rfpFieldBased = VSFieldBased::VSC_FIELD_PROGRESSIVE;
} else if (typeSpecificFlags & AM_VIDEO_FLAG_FIELD1FIRST) {
rfpFieldBased = VSFieldBased::VSC_FIELD_TOP;
} else {
rfpFieldBased = VSFieldBased::VSC_FIELD_BOTTOM;
}
const int rfpFieldBased = [&]() {
if (typeSpecificFlags & AM_VIDEO_FLAG_WEAVE) {
return VSFieldBased::VSC_FIELD_PROGRESSIVE;
} else if (typeSpecificFlags & AM_VIDEO_FLAG_FIELD1FIRST) {
return VSFieldBased::VSC_FIELD_TOP;
} else {
return VSFieldBased::VSC_FIELD_BOTTOM;
}
}();
AVSF_AVS_API->propSetInt(frameProps, FRAME_PROP_NAME_FIELD_BASED, rfpFieldBased, PROPAPPENDMODE_REPLACE);
}

Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ if (!(Test-Path $workingDir)) {
git clone https://github.com/brofield/simpleini.git --depth=1 dep_simpleini
}

MSBuild.exe -property:"Configuration=${configuration};Platform=${platform}" -maxCpuCount avisynth_filter.sln
MSBuild.exe -property:"Configuration=${configuration};Platform=${platform}" -maxCpuCount -nologo avisynth_filter.sln
exit $LASTEXITCODE
2 changes: 1 addition & 1 deletion filter_common/src/side_data.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// https://github.com/Nevcairiel/LAVFilters/blob/master/common/includes/IMediaSideData.h
// https://github.com/Nevcairiel/LAVFilters/blob/39bc2a8c75ffb1a625a75c04e9b4f6a8ab90e633/include/IMediaSideData.h

// -----------------------------------------------------------------
// IMediaSideData interface and data structure definitions
Expand Down
17 changes: 9 additions & 8 deletions vapoursynth_filter/src/frame_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ auto FrameHandler::AddInputSample(IMediaSample *inputSample) -> HRESULT {
AVSF_VPS_API->mapSetInt(frameProps, "_Transfer", _filter._inputVideoFormat.colorSpaceInfo.transfer, maReplace);

const DWORD typeSpecificFlags = _filter.m_pInput->SampleProps()->dwTypeSpecificFlags;
int rfpFieldBased;
if (typeSpecificFlags & AM_VIDEO_FLAG_WEAVE) {
rfpFieldBased = VSFieldBased::VSC_FIELD_PROGRESSIVE;
} else if (typeSpecificFlags & AM_VIDEO_FLAG_FIELD1FIRST) {
rfpFieldBased = VSFieldBased::VSC_FIELD_TOP;
} else {
rfpFieldBased = VSFieldBased::VSC_FIELD_BOTTOM;
}
const int rfpFieldBased = [&]() {
if (typeSpecificFlags & AM_VIDEO_FLAG_WEAVE) {
return VSFieldBased::VSC_FIELD_PROGRESSIVE;
} else if (typeSpecificFlags & AM_VIDEO_FLAG_FIELD1FIRST) {
return VSFieldBased::VSC_FIELD_TOP;
} else {
return VSFieldBased::VSC_FIELD_BOTTOM;
}
}();
AVSF_VPS_API->mapSetInt(frameProps, FRAME_PROP_NAME_FIELD_BASED, rfpFieldBased, maReplace);
AVSF_VPS_API->mapSetInt(frameProps, FRAME_PROP_NAME_TYPE_SPECIFIC_FLAGS, typeSpecificFlags, maReplace);

Expand Down

0 comments on commit 4d1c211

Please sign in to comment.