Package org.mp4parser.boxes.microsoft
Class XtraBox
- java.lang.Object
-
- org.mp4parser.support.AbstractBox
-
- org.mp4parser.boxes.microsoft.XtraBox
-
- All Implemented Interfaces:
Box
,ParsableBox
public class XtraBox extends AbstractBox
4cc = ""Xtra""
Windows Media Xtra Box.
I can't find definitive documentation on this from Microsoft so it's cobbled together from various sources. Mostly ExifTool for Perl.
Various references: https://msdn.microsoft.com/en-us/library/windows/desktop/dd743066(v=vs.85).aspx https://metacpan.org/source/EXIFTOOL/Image-ExifTool-9.76/lib/Image/ExifTool/Microsoft.pm http://www.ventismedia.com/mantis/view.php?id=12017 http://www.hydrogenaudio.org/forums/index.php?showtopic=75123&st=250 http://www.mediamonkey.com/forum/viewtopic.php?f=1&t=76321 https://code.google.com/p/mp4v2/issues/detail?id=113- Author:
- marwatk
-
-
Field Summary
Fields Modifier and Type Field Description static int
MP4_XTRA_BT_FILETIME
static int
MP4_XTRA_BT_GUID
static int
MP4_XTRA_BT_INT64
static int
MP4_XTRA_BT_UNICODE
static String
TYPE
-
Fields inherited from class org.mp4parser.support.AbstractBox
content, type
-
-
Method Summary
Modifier and Type Method Description void
_parseDetails(ByteBuffer content)
Parse the box's fields and child boxes if any.String[]
getAllTagNames()
Returns a list of the tag names present in this Xtra Boxprotected void
getContent(ByteBuffer byteBuffer)
Write the box's content into the givenByteBuffer
.protected long
getContentSize()
Get the box's content size without its header.Date
getFirstDateValue(String name)
Returns the first Date value found for this tagLong
getFirstLongValue(String name)
Returns the first Long value found for this tagString
getFirstStringValue(String name)
Returns the first String value found for this tagObject[]
getValues(String name)
Returns an array of values for this tag.void
removeTag(String name)
Removes specified tag (all values for that tag will be removed)void
setTagValue(String name, long value)
Removes and recreates tag using specified Long valuevoid
setTagValue(String name, String value)
Removes and recreates tag using specified String valuevoid
setTagValue(String name, Date date)
Removes and recreates tag using specified Date valuevoid
setTagValues(String name, String[] values)
Removes and recreates tag using specified String valuesString
toString()
-
Methods inherited from class org.mp4parser.support.AbstractBox
getBox, getSize, getType, getUserType, isParsed, parse, parseDetails
-
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
MP4_XTRA_BT_UNICODE
public static final int MP4_XTRA_BT_UNICODE
- See Also:
- Constant Field Values
-
MP4_XTRA_BT_INT64
public static final int MP4_XTRA_BT_INT64
- See Also:
- Constant Field Values
-
MP4_XTRA_BT_FILETIME
public static final int MP4_XTRA_BT_FILETIME
- See Also:
- Constant Field Values
-
MP4_XTRA_BT_GUID
public static final int MP4_XTRA_BT_GUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XtraBox
public XtraBox()
-
XtraBox
public XtraBox(String type)
-
-
Method Detail
-
getContentSize
protected long getContentSize()
Description copied from class:AbstractBox
Get the box's content size without its header. This must be the exact number of bytes thatgetContent(ByteBuffer)
writes.- Specified by:
getContentSize
in classAbstractBox
- Returns:
- Gets the box's content size in bytes
- See Also:
AbstractBox.getContent(java.nio.ByteBuffer)
-
_parseDetails
public void _parseDetails(ByteBuffer content)
Description copied from class:AbstractBox
Parse the box's fields and child boxes if any.- Specified by:
_parseDetails
in classAbstractBox
- Parameters:
content
- the box's raw content beginning after the 4-cc field.
-
getContent
protected void getContent(ByteBuffer byteBuffer)
Description copied from class:AbstractBox
Write the box's content into the givenByteBuffer
. This must include flags and version in case of a full box.byteBuffer
has been initialized withgetSize()
bytes.- Specified by:
getContent
in classAbstractBox
- Parameters:
byteBuffer
- the sink for the box's content
-
getAllTagNames
public String[] getAllTagNames()
Returns a list of the tag names present in this Xtra Box- Returns:
- Possibly empty (zero length) array of tag names present
-
getFirstStringValue
public String getFirstStringValue(String name)
Returns the first String value found for this tag- Parameters:
name
- Tag name- Returns:
- First String value found
-
getFirstDateValue
public Date getFirstDateValue(String name)
Returns the first Date value found for this tag- Parameters:
name
- Tag name- Returns:
- First Date value found
-
getFirstLongValue
public Long getFirstLongValue(String name)
Returns the first Long value found for this tag- Parameters:
name
- Tag name- Returns:
- First long value found
-
getValues
public Object[] getValues(String name)
Returns an array of values for this tag. Empty array when tag is not present- Parameters:
name
- Tag name to retrieve- Returns:
- Possibly empty array of values (possible types are String, Long, Date and byte[] )
-
removeTag
public void removeTag(String name)
Removes specified tag (all values for that tag will be removed)- Parameters:
name
- Tag to remove
-
setTagValues
public void setTagValues(String name, String[] values)
Removes and recreates tag using specified String values- Parameters:
name
- Tag name to replacevalues
- New String values
-
setTagValue
public void setTagValue(String name, String value)
Removes and recreates tag using specified String value- Parameters:
name
- Tag name to replacevalue
- New String value
-
setTagValue
public void setTagValue(String name, Date date)
Removes and recreates tag using specified Date value- Parameters:
name
- Tag name to replacedate
- New Date value
-
setTagValue
public void setTagValue(String name, long value)
Removes and recreates tag using specified Long value- Parameters:
name
- Tag name to replacevalue
- New Long value
-
-