-
Notifications
You must be signed in to change notification settings - Fork 6
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
implemented VideoSequenceParser inspired by SDK_Segment_Utils.VideoSequencerParser from original SDK #67
base: master
Are you sure you want to change the base?
implemented VideoSequenceParser inspired by SDK_Segment_Utils.VideoSequencerParser from original SDK #67
Changes from 6 commits
949a8fd
00ea6d7
c694143
60a9300
3d33a14
1f8524a
9318270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
use crate::*; | ||
use pr_sys::*; | ||
use std::collections::HashMap; | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct ClipOperator { | ||
pub node_id: i32, | ||
pub node_type: String, | ||
pub hash: prPluginID, | ||
pub flags: i32, | ||
} | ||
|
||
pub type ClipOperatorsMap = HashMap<i32, ClipOperator>; | ||
|
||
pub struct VideoSequenceParser { | ||
segment_suite: suites::VideoSegment, | ||
} | ||
|
||
impl VideoSequenceParser { | ||
pub fn new() -> Result<Self, Error> { | ||
Ok(Self { | ||
segment_suite: suites::VideoSegment::new()?, | ||
}) | ||
} | ||
|
||
pub fn parse_clip_operators(&self, clip_node_id: i32) -> Result<ClipOperatorsMap, Error> { | ||
let clip_node_operators = self.segment_suite.node_operator_count(clip_node_id)?; | ||
let mut operators_map: ClipOperatorsMap = HashMap::new(); | ||
|
||
for operator_node_index in 0..clip_node_operators { | ||
let operator_node_id = self | ||
.segment_suite | ||
.acquire_operator_node_id(clip_node_id, operator_node_index)?; | ||
|
||
let (operator_node_type, operator_node_hash, operator_node_flags) = | ||
self.segment_suite.node_info(operator_node_id)?; | ||
|
||
log::debug!( | ||
"Clip Operator: {:?} {:?} {:?}", | ||
operator_node_type, | ||
operator_node_hash, | ||
operator_node_flags | ||
); | ||
Comment on lines
+38
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of all these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or return a tuple of the current |
||
|
||
if operator_node_type | ||
== String::from_utf8_lossy(kVideoSegment_NodeType_Effect).to_string() | ||
{ | ||
let effect_name = self | ||
.segment_suite | ||
.node_property(operator_node_id, Property::Effect_FilterMatchName) | ||
.unwrap_or_else(|_| PropertyData::String("<Unknown Effect>".to_string())); | ||
log::debug!("\tEffect: {:?}", effect_name); | ||
|
||
let effect_instance_id = self | ||
.segment_suite | ||
.node_property(operator_node_id, Property::Effect_RuntimeInstanceID); | ||
log::debug!("\tEffect Instance ID: {:?}", effect_instance_id); | ||
|
||
let filter_params = self | ||
.segment_suite | ||
.node_property(operator_node_id, Property::Effect_FilterParams); | ||
log::debug!("\tEffect Params: {filter_params:?}"); | ||
} | ||
|
||
operators_map.insert( | ||
operator_node_id, | ||
ClipOperator { | ||
node_id: operator_node_id, | ||
node_type: operator_node_type, | ||
hash: operator_node_hash, | ||
flags: operator_node_flags, | ||
}, | ||
); | ||
self.segment_suite.release_video_node_id(operator_node_id)?; | ||
} | ||
|
||
Ok(operators_map) | ||
} | ||
} |
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.
What does this silence? Instead of this, can we fix the clippy lints, or at least silence only specific ones?