-
-
Notifications
You must be signed in to change notification settings - Fork 72
Timecode meta #205
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
Timecode meta #205
Conversation
Thanks for this, and for adding tests! I'll try and find some free time to review soon. At a glance seems to be in right direction, but can you add links to upstream docs (or code in the case of lowlevel) to the Javadocs as other classes have. This keeps our requirement to document a little lower, and makes for easier review. Travis tests seem to be failing. Bear in mind that all tests should pass with GStreamer 1.8, currently our baseline. Or are we missing availability of GStreamer elements? Features from higher versions need to be guarded and tests not run. See eg. https://github.com/gstreamer-java/gst1-java-core/blob/master/src/org/freedesktop/gstreamer/Buffer.java#L249 and https://github.com/gstreamer-java/gst1-java-core/blob/master/test/org/freedesktop/gstreamer/PropertyTypeTest.java#L188 |
@@ -5,3 +5,4 @@ addons: | |||
apt: | |||
packages: | |||
- gstreamer1.0-plugins-good | |||
- gstreamer1.0-plugins-bad |
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.
Is there any feasible way to test this that doesn't require adding gstreamer1.0-plugins-bad
? We've generally tried to keep that out of test requirements.
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.
I just need these plugins not for production but just for tests. There is timecodestamper which can be used for testing timecode metadata. But true is that timecodestamper
is available since 1.10.
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.
Yes, just wondering if there's any way to do test differently without this element? If we can keep the test requirements to plugins-good, I'd be happier.
@@ -142,7 +141,7 @@ public long getDecodeTimestamp() { | |||
* Set the decode timestamp of the Buffer | |||
* | |||
* @param val a long representing the timestamp or | |||
* {@link ClockTime#NONE} when the timestamp is not known or relevant. | |||
* {@link ClockTime#NONE} when the timestamp is not known or relevant. |
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.
Please keep whitespace changes out of this where you can, thanks.
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.
Sorry about that, I forgot to uncheck the checkbox for formatting code before commit.
* | ||
* @return return time code (SMPTE) for current buffer | ||
*/ | ||
public GstVideoTimeCodeMeta getVideoTimeCodeMeta() { |
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.
I'm unsure about the API here. Maybe we need a getMeta()
method that takes a type, which should probably be specified by Java class. Will check upstream docs.
The type here should be VideoTimeCodeMeta
- the Gst
prefix should only be used in lowlevel
package. Helps to make sure we're not exposing things we shouldn't be!
import org.freedesktop.gstreamer.timecode.GstVideoTimeCodeFlags; | ||
|
||
/** | ||
* @author Jokertwo |
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.
Please remove the author annotation. Add license headers and add your real name in copyright lines. Also feel free to add your name in a copyright line on modified files if you wish.
* Gst meta data GTypes | ||
* @author Jokertwo | ||
*/ | ||
public enum GstMetaData { |
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.
I'm not sure enum seems right here - would expect probably Java types like messages, events and queries. Thoughts?
* @author Jokertwo | ||
* @see <a href="https://gstreamer.freedesktop.org/documentation/gstreamer/gstmeta.html?gi-language=c#GstMetaInfo">GstMetaInfo</a> | ||
*/ | ||
public class GstMetaInfo extends MiniObject { |
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.
Should be called MetaInfo.
/** | ||
* @author Jokertwo | ||
*/ | ||
public class GstMeta implements NativeObject.TypeProvider { |
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.
Should be called Meta. Should specific Meta extend from this? What is the Meta hierarchy? Java class hierarchy should generally match with GType hierarchy.
The Type.Provider
implementation should probably be nested, like Message.Types
* @author Jokertwo | ||
* @see <a href="https://docs.gstreamer.com/documentation/video/gstvideometa.html?gi-language=c#GstVideoTimeCodeMeta">GstVideoTimeCodeMeta</a> | ||
*/ | ||
public class GstVideoTimeCodeMeta extends MiniObject { |
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.
VideoTimeCodeMeta. Is this really a MiniObject?
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.
I do not know, how to resolve if is it MiniObject or not?
* @author Jokertwo | ||
* @see <a href="https://docs.gstreamer.com/documentation/video/gstvideotimecode.html?gi-language=c#GstVideoTimeCode">GstVideoTimeCode</a> | ||
*/ | ||
public class GstVideoTimeCode extends MiniObject { |
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.
VideoTimeCode. Really a MiniObject? Do we really need a separate package for this?
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.
I do not know, how to resolve if is it MiniObject or not?
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.
You should see a GstMiniObject as first element of the struct - eg. https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/master/gst/gstbuffer.h#L265 Or you could try calling various bits of the MiniObject API on them, which will likely crash! 😄 Hence need to be careful here. Likely that you'll want to extend NativeObject directly if anything - check out other classes that directly extend that.
* @author Jokertwo | ||
* @see <a href="https://docs.gstreamer.com/documentation/video/gstvideotimecode.html?gi-language=c#GstVideoTimeCodeConfig">GstVideoTimeCodeConfig</a> | ||
*/ | ||
public class GstVideoTimeCodeConfig extends MiniObject { |
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.
VideoTimeCodeConfig. Really a MiniObject?
Fix comments from Neil
I hope that I fixed all your comments |
Thanks. I'll take a look as soon as I can - probably won't be able to for at least a week. |
Sorry this is taking so long - few other projects going through releases and hitting some teething problems. Have scheduled some time for next week to fully review. Thanks for your patience! |
Thanks for looking at this. I still have some issues with it as is. I'm still not sure about the package structure, a few of the method names, the license headers are in the wrong place and mixed up with what should be Javadocs, and I'd still like to get tests working without plugins bad if at all possible. I'm going to change the base branch for this and merge into a specific branch here to work on together before it hits master. |
@aveco-devel I've started reviewing through, and working out a task list for merging this code. Unfortunately, I hadn't realised quite how much this was exposing lowlevel package types (eg. GType) and JNA types (eg. Pointer). Neither are allowed in our public API as a rule. Feel free to join in the discussion on the linked thread if you wish, and thanks for your work to date. |
I implemented the possibility to get additional metadata from each buffer. Currently, there is only metadata for time codes. In our company, we use these values for navigation in the video (for obtaining exactly the position of showed frame). But there really depends on how the video was created, container type, and codec type. Not all buffers/frames come with attached this kind of metadata.
This is the first time when I wrote some binding over C library, so I hope that I understood correctly how to do it and this extension will be useful also for someone else.