-
Notifications
You must be signed in to change notification settings - Fork 38
Add upipe_interlace #1140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
quarium
wants to merge
2
commits into
Upipe:master
Choose a base branch
from
quarium:upipe_interlace
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add upipe_interlace #1140
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| /* | ||
| * Copyright (C) 2026 EasyTools | ||
| * | ||
| * Authors: Arnaud de Turckheim | ||
| * | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
|
|
||
| /** @file | ||
| * @short Upipe interlacing module | ||
| */ | ||
|
|
||
| #ifndef _UPIPE_MODULES_UPIPE_INTERLACE_H_ | ||
| /** @hidden */ | ||
| #define _UPIPE_MODULES_UPIPE_INTERLACE_H_ | ||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #include "upipe/upipe.h" | ||
|
|
||
| #define UPIPE_INTERLACE_SIGNATURE UBASE_FOURCC('i','n','t','l') | ||
|
|
||
| /** @This extends upipe_command with specific commands for interlace pipes. */ | ||
| enum upipe_interlace_command { | ||
| UPIPE_INTERLACE_SENTINEL = UPIPE_CONTROL_LOCAL, | ||
|
|
||
| /** set top field first output (bool) */ | ||
| UPIPE_INTERLACE_SET_TFF, | ||
| /** get the configured value for top field first output (bool *) */ | ||
| UPIPE_INTERLACE_GET_TFF, | ||
| /** set field drop (bool) */ | ||
| UPIPE_INTERLACE_SET_DROP, | ||
| /** get the configured value for field drop (bool *) */ | ||
| UPIPE_INTERLACE_GET_DROP, | ||
| /** set low pass filter (bool) */ | ||
| UPIPE_INTERLACE_SET_LOWPASS, | ||
| /** get the configured value for low pass filter (bool *) */ | ||
| UPIPE_INTERLACE_GET_LOWPASS, | ||
| }; | ||
|
|
||
| /** @This converts @ref upipe_interlace_command to a string. | ||
| * | ||
| * @param command command to convert | ||
| * @return a string or NULL if invalid | ||
| */ | ||
| static inline const char *upipe_interlace_command_str(int command) | ||
| { | ||
| switch ((enum upipe_interlace_command)command) { | ||
| UBASE_CASE_TO_STR(UPIPE_INTERLACE_SET_TFF); | ||
| UBASE_CASE_TO_STR(UPIPE_INTERLACE_GET_TFF); | ||
| UBASE_CASE_TO_STR(UPIPE_INTERLACE_SET_DROP); | ||
| UBASE_CASE_TO_STR(UPIPE_INTERLACE_GET_DROP); | ||
| UBASE_CASE_TO_STR(UPIPE_INTERLACE_SET_LOWPASS); | ||
| UBASE_CASE_TO_STR(UPIPE_INTERLACE_GET_LOWPASS); | ||
| case UPIPE_INTERLACE_SENTINEL: break; | ||
| } | ||
| return NULL; | ||
| } | ||
|
|
||
| /** @This sets the top field first output. | ||
| * | ||
| * @param upipe description structure of the pipe | ||
| * @param tff true for top field first, false for bottom field first | ||
| * @return an error code | ||
| */ | ||
| static inline int upipe_interlace_set_tff(struct upipe *upipe, bool tff) | ||
| { | ||
| return upipe_control(upipe, UPIPE_INTERLACE_SET_TFF, | ||
| UPIPE_INTERLACE_SIGNATURE, tff ? 1 : 0); | ||
| } | ||
|
|
||
| /** @This gets the top field first output configuration. | ||
| * | ||
| * @param upipe description structure of the pipe | ||
| * @param tff filled with the configured value | ||
| * @return an error code | ||
| */ | ||
| static inline int upipe_interlace_get_tff(struct upipe *upipe, bool *tff) | ||
| { | ||
| return upipe_control(upipe, UPIPE_INTERLACE_GET_TFF, | ||
| UPIPE_INTERLACE_SIGNATURE, tff); | ||
| } | ||
|
|
||
| /** @This sets field drop. | ||
| * | ||
| * If set to true, two frames are merged into one, keeping one field | ||
| * of each, so the output frame rate will be divided by two. | ||
| * | ||
| * 1111 2222 3333 4444 -> 1111 3333 | ||
| * 1111 2222 3333 4444 2222 4444 | ||
| * 1111 2222 3333 4444 1111 3333 | ||
| * 1111 2222 3333 4444 2222 4444 | ||
| * | ||
| * If set to false, each frame is merged with the previous and the | ||
| * next so the output frame rate is unchanged. | ||
| * | ||
| * 1111 2222 3333 4444 -> 1111 2222 3333 4444 | ||
| * 1111 2222 3333 4444 2222 3333 4444 5555 | ||
| * 1111 2222 3333 4444 1111 2222 3333 4444 | ||
| * 1111 2222 3333 4444 2222 3333 4444 5555 | ||
| * | ||
| * @param upipe description structure of the pipe | ||
| * @param drop true for dropping field | ||
| * @return an error code | ||
| */ | ||
| static inline int upipe_interlace_set_drop(struct upipe *upipe, bool drop) | ||
| { | ||
| return upipe_control(upipe, UPIPE_INTERLACE_SET_DROP, | ||
| UPIPE_INTERLACE_SIGNATURE, drop ? 1 : 0); | ||
| } | ||
|
|
||
| /** @This gets the field drop configuration. | ||
| * | ||
| * @param upipe description structure of the pipe | ||
| * @param drop filled with the configured value | ||
| * @return an error code | ||
| */ | ||
| static inline int upipe_interlace_get_drop(struct upipe *upipe, bool *drop) | ||
| { | ||
| return upipe_control(upipe, UPIPE_INTERLACE_GET_DROP, | ||
| UPIPE_INTERLACE_SIGNATURE, drop); | ||
| } | ||
|
|
||
| /** @This sets low pass filter. | ||
| * | ||
| * @param upipe description structure of the pipe | ||
| * @param lowpass true to enable low pass filter | ||
| * @return an error code | ||
| */ | ||
| static inline int upipe_interlace_set_lowpass(struct upipe *upipe, bool lowpass) | ||
| { | ||
| return upipe_control(upipe, UPIPE_INTERLACE_SET_LOWPASS, | ||
| UPIPE_INTERLACE_SIGNATURE, lowpass ? 1 : 0); | ||
| } | ||
|
|
||
| /** @This gets the configured value for low pass filter. | ||
| * | ||
| * @param upipe description structure of the pipe | ||
| * @param lowpass filled with the configured value | ||
| * @return an error code | ||
| */ | ||
| static inline int upipe_interlace_get_lowpass(struct upipe *upipe, | ||
| bool *lowpass) | ||
| { | ||
| return upipe_control(upipe, UPIPE_INTERLACE_GET_LOWPASS, | ||
| UPIPE_INTERLACE_SIGNATURE, lowpass); | ||
| } | ||
|
|
||
| /** @This returns the management structure for all interlace pipes. | ||
| * | ||
| * @return pointer to manager | ||
| */ | ||
| struct upipe_mgr * | ||
| upipe_interlace_mgr_alloc(void); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.