Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3b34f850
authored
Oct 09, 2016
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Clean up ID3 frame implementations
parent
6a3b6698
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
150 additions
and
153 deletions
library/src/main/java/com/google/android/exoplayer2/metadata/id3/ApicFrame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/BinaryFrame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/CommentFrame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/GeobFrame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Frame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/PrivFrame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/TextInformationFrame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/TxxxFrame.java
library/src/main/java/com/google/android/exoplayer2/metadata/id3/ApicFrame.java
View file @
3b34f850
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
import
android.os.Parcel
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
/**
...
@@ -39,8 +40,8 @@ public final class ApicFrame extends Id3Frame {
...
@@ -39,8 +40,8 @@ public final class ApicFrame extends Id3Frame {
this
.
pictureData
=
pictureData
;
this
.
pictureData
=
pictureData
;
}
}
public
ApicFrame
(
Parcel
in
)
{
/* package */
ApicFrame
(
Parcel
in
)
{
super
(
in
);
super
(
ID
);
mimeType
=
in
.
readString
();
mimeType
=
in
.
readString
();
description
=
in
.
readString
();
description
=
in
.
readString
();
pictureType
=
in
.
readInt
();
pictureType
=
in
.
readInt
();
...
@@ -48,53 +49,49 @@ public final class ApicFrame extends Id3Frame {
...
@@ -48,53 +49,49 @@ public final class ApicFrame extends Id3Frame {
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
obj
)
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
return
true
;
}
ApicFrame
that
=
(
ApicFrame
)
o
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
if
(
pictureType
!=
that
.
pictureType
)
return
false
;
if
(
mimeType
!=
null
?
!
mimeType
.
equals
(
that
.
mimeType
)
:
that
.
mimeType
!=
null
)
return
false
;
return
false
;
if
(
description
!=
null
?
!
description
.
equals
(
that
.
description
)
:
that
.
description
!=
null
)
}
return
false
;
ApicFrame
other
=
(
ApicFrame
)
obj
;
return
Arrays
.
equals
(
pictureData
,
that
.
pictureData
);
return
pictureType
==
other
.
pictureType
&&
Util
.
areEqual
(
mimeType
,
other
.
mimeType
)
&&
Util
.
areEqual
(
description
,
other
.
description
)
&&
Arrays
.
equals
(
pictureData
,
other
.
pictureData
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
result
=
id
!=
null
?
id
.
hashCode
()
:
0
;
int
result
=
17
;
result
=
31
*
result
+
pictureType
;
result
=
31
*
result
+
(
mimeType
!=
null
?
mimeType
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
mimeType
!=
null
?
mimeType
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
pictureType
;
result
=
31
*
result
+
Arrays
.
hashCode
(
pictureData
);
result
=
31
*
result
+
Arrays
.
hashCode
(
pictureData
);
return
result
;
return
result
;
}
}
@Override
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
id
);
dest
.
writeString
(
mimeType
);
dest
.
writeString
(
mimeType
);
dest
.
writeString
(
description
);
dest
.
writeString
(
description
);
dest
.
writeInt
(
pictureType
);
dest
.
writeInt
(
pictureType
);
dest
.
writeByteArray
(
pictureData
);
dest
.
writeByteArray
(
pictureData
);
}
}
public
static
final
Parcelable
.
Creator
<
ApicFrame
>
CREATOR
=
public
static
final
Parcelable
.
Creator
<
ApicFrame
>
CREATOR
=
new
Parcelable
.
Creator
<
ApicFrame
>()
{
new
Parcelable
.
Creator
<
ApicFrame
>()
{
@Override
@Override
public
ApicFrame
createFromParcel
(
Parcel
in
)
{
public
ApicFrame
createFromParcel
(
Parcel
in
)
{
return
new
ApicFrame
(
in
);
return
new
ApicFrame
(
in
);
}
}
@Override
@Override
public
ApicFrame
[]
newArray
(
int
size
)
{
public
ApicFrame
[]
newArray
(
int
size
)
{
return
new
ApicFrame
[
size
];
return
new
ApicFrame
[
size
];
}
}
};
};
}
}
library/src/main/java/com/google/android/exoplayer2/metadata/id3/BinaryFrame.java
View file @
3b34f850
...
@@ -26,31 +26,32 @@ public final class BinaryFrame extends Id3Frame {
...
@@ -26,31 +26,32 @@ public final class BinaryFrame extends Id3Frame {
public
final
byte
[]
data
;
public
final
byte
[]
data
;
public
BinaryFrame
(
String
type
,
byte
[]
data
)
{
public
BinaryFrame
(
String
id
,
byte
[]
data
)
{
super
(
type
);
super
(
id
);
this
.
data
=
data
;
this
.
data
=
data
;
}
}
public
BinaryFrame
(
Parcel
in
)
{
/* package */
BinaryFrame
(
Parcel
in
)
{
super
(
in
);
super
(
in
.
readString
()
);
data
=
in
.
createByteArray
();
data
=
in
.
createByteArray
();
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
obj
)
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
return
true
;
}
BinaryFrame
that
=
(
BinaryFrame
)
o
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
return
false
;
return
Arrays
.
equals
(
data
,
that
.
data
);
}
BinaryFrame
other
=
(
BinaryFrame
)
obj
;
return
id
.
equals
(
other
.
id
)
&&
Arrays
.
equals
(
data
,
other
.
data
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
result
=
id
!=
null
?
id
.
hashCode
()
:
0
;
int
result
=
17
;
result
=
31
*
result
+
id
.
hashCode
();
result
=
31
*
result
+
Arrays
.
hashCode
(
data
);
result
=
31
*
result
+
Arrays
.
hashCode
(
data
);
return
result
;
return
result
;
}
}
...
...
library/src/main/java/com/google/android/exoplayer2/metadata/id3/CommentFrame.java
View file @
3b34f850
...
@@ -17,43 +17,51 @@ package com.google.android.exoplayer2.metadata.id3;
...
@@ -17,43 +17,51 @@ package com.google.android.exoplayer2.metadata.id3;
import
android.os.Parcel
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
com.google.android.exoplayer2.util.Util
;
/**
/**
* Comment ID3 frame.
* Comment ID3 frame.
*/
*/
public
final
class
CommentFrame
extends
Id3Frame
{
public
final
class
CommentFrame
extends
Id3Frame
{
public
static
final
String
ID
=
"COMM"
;
public
final
String
language
;
public
final
String
language
;
public
final
String
description
;
public
final
String
text
;
public
final
String
text
;
public
CommentFrame
(
String
language
,
String
description
,
String
text
)
{
public
CommentFrame
(
String
language
,
String
description
,
String
text
)
{
super
(
description
);
super
(
ID
);
this
.
language
=
language
;
this
.
language
=
language
;
this
.
description
=
description
;
this
.
text
=
text
;
this
.
text
=
text
;
}
}
public
CommentFrame
(
Parcel
in
)
{
/* package */
CommentFrame
(
Parcel
in
)
{
super
(
in
);
super
(
ID
);
language
=
in
.
readString
();
language
=
in
.
readString
();
description
=
in
.
readString
();
text
=
in
.
readString
();
text
=
in
.
readString
();
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
obj
)
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
return
true
;
}
CommentFrame
that
=
(
CommentFrame
)
o
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
return
false
;
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
}
if
(
language
!=
null
?
!
language
.
equals
(
that
.
language
)
:
that
.
language
!=
null
)
return
false
;
CommentFrame
other
=
(
CommentFrame
)
obj
;
return
text
!=
null
?
text
.
equals
(
that
.
text
)
:
that
.
text
==
null
;
return
Util
.
areEqual
(
description
,
other
.
description
)
&&
Util
.
areEqual
(
language
,
other
.
language
)
&&
Util
.
areEqual
(
text
,
other
.
text
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
result
=
id
!=
null
?
id
.
hashCode
()
:
0
;
int
result
=
17
;
result
=
31
*
result
+
(
language
!=
null
?
language
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
language
!=
null
?
language
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
text
!=
null
?
text
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
text
!=
null
?
text
.
hashCode
()
:
0
);
return
result
;
return
result
;
}
}
...
...
library/src/main/java/com/google/android/exoplayer2/metadata/id3/GeobFrame.java
View file @
3b34f850
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
import
android.os.Parcel
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
/**
...
@@ -39,8 +40,8 @@ public final class GeobFrame extends Id3Frame {
...
@@ -39,8 +40,8 @@ public final class GeobFrame extends Id3Frame {
this
.
data
=
data
;
this
.
data
=
data
;
}
}
public
GeobFrame
(
Parcel
in
)
{
/* package */
GeobFrame
(
Parcel
in
)
{
super
(
in
);
super
(
ID
);
mimeType
=
in
.
readString
();
mimeType
=
in
.
readString
();
filename
=
in
.
readString
();
filename
=
in
.
readString
();
description
=
in
.
readString
();
description
=
in
.
readString
();
...
@@ -48,25 +49,21 @@ public final class GeobFrame extends Id3Frame {
...
@@ -48,25 +49,21 @@ public final class GeobFrame extends Id3Frame {
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
obj
)
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
return
true
;
}
GeobFrame
that
=
(
GeobFrame
)
o
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
if
(
mimeType
!=
null
?
!
mimeType
.
equals
(
that
.
mimeType
)
:
that
.
mimeType
!=
null
)
return
false
;
if
(
filename
!=
null
?
!
filename
.
equals
(
that
.
filename
)
:
that
.
filename
!=
null
)
return
false
;
if
(
description
!=
null
?
!
description
.
equals
(
that
.
description
)
:
that
.
description
!=
null
)
return
false
;
return
false
;
return
Arrays
.
equals
(
data
,
that
.
data
);
}
GeobFrame
other
=
(
GeobFrame
)
obj
;
return
Util
.
areEqual
(
mimeType
,
other
.
mimeType
)
&&
Util
.
areEqual
(
filename
,
other
.
filename
)
&&
Util
.
areEqual
(
description
,
other
.
description
)
&&
Arrays
.
equals
(
data
,
other
.
data
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
result
=
id
!=
null
?
id
.
hashCode
()
:
0
;
int
result
=
17
;
result
=
31
*
result
+
(
mimeType
!=
null
?
mimeType
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
mimeType
!=
null
?
mimeType
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
filename
!=
null
?
filename
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
filename
!=
null
?
filename
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
...
@@ -76,26 +73,24 @@ public final class GeobFrame extends Id3Frame {
...
@@ -76,26 +73,24 @@ public final class GeobFrame extends Id3Frame {
@Override
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
id
);
dest
.
writeString
(
mimeType
);
dest
.
writeString
(
mimeType
);
dest
.
writeString
(
filename
);
dest
.
writeString
(
filename
);
dest
.
writeString
(
description
);
dest
.
writeString
(
description
);
dest
.
writeByteArray
(
data
);
dest
.
writeByteArray
(
data
);
}
}
public
static
final
Parcelable
.
Creator
<
GeobFrame
>
CREATOR
=
public
static
final
Parcelable
.
Creator
<
GeobFrame
>
CREATOR
=
new
Parcelable
.
Creator
<
GeobFrame
>()
{
new
Parcelable
.
Creator
<
GeobFrame
>()
{
@Override
@Override
public
GeobFrame
createFromParcel
(
Parcel
in
)
{
public
GeobFrame
createFromParcel
(
Parcel
in
)
{
return
new
GeobFrame
(
in
);
return
new
GeobFrame
(
in
);
}
}
@Override
@Override
public
GeobFrame
[]
newArray
(
int
size
)
{
public
GeobFrame
[]
newArray
(
int
size
)
{
return
new
GeobFrame
[
size
];
return
new
GeobFrame
[
size
];
}
}
};
};
}
}
library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java
View file @
3b34f850
...
@@ -345,8 +345,8 @@ public final class Id3Decoder implements MetadataDecoder<Metadata> {
...
@@ -345,8 +345,8 @@ public final class Id3Decoder implements MetadataDecoder<Metadata> {
return
new
TextInformationFrame
(
id
,
description
);
return
new
TextInformationFrame
(
id
,
description
);
}
}
private
static
CommentFrame
decodeCommentFrame
(
ParsableByteArray
id3Data
,
private
static
CommentFrame
decodeCommentFrame
(
ParsableByteArray
id3Data
,
int
frameSize
)
int
frameSize
)
throws
UnsupportedEncodingException
{
throws
UnsupportedEncodingException
{
int
encoding
=
id3Data
.
readUnsignedByte
();
int
encoding
=
id3Data
.
readUnsignedByte
();
String
charset
=
getCharsetName
(
encoding
);
String
charset
=
getCharsetName
(
encoding
);
...
@@ -360,11 +360,11 @@ public final class Id3Decoder implements MetadataDecoder<Metadata> {
...
@@ -360,11 +360,11 @@ public final class Id3Decoder implements MetadataDecoder<Metadata> {
int
descriptionEndIndex
=
indexOfEos
(
data
,
0
,
encoding
);
int
descriptionEndIndex
=
indexOfEos
(
data
,
0
,
encoding
);
String
description
=
new
String
(
data
,
0
,
descriptionEndIndex
,
charset
);
String
description
=
new
String
(
data
,
0
,
descriptionEndIndex
,
charset
);
int
value
StartIndex
=
descriptionEndIndex
+
delimiterLength
(
encoding
);
int
text
StartIndex
=
descriptionEndIndex
+
delimiterLength
(
encoding
);
int
valueEndIndex
=
indexOfEos
(
data
,
value
StartIndex
,
encoding
);
int
textEndIndex
=
indexOfEos
(
data
,
text
StartIndex
,
encoding
);
String
value
=
new
String
(
data
,
valueStartIndex
,
valueEndIndex
-
value
StartIndex
,
charset
);
String
text
=
new
String
(
data
,
textStartIndex
,
textEndIndex
-
text
StartIndex
,
charset
);
return
new
CommentFrame
(
language
,
description
,
value
);
return
new
CommentFrame
(
language
,
description
,
text
);
}
}
private
static
BinaryFrame
decodeBinaryFrame
(
ParsableByteArray
id3Data
,
int
frameSize
,
private
static
BinaryFrame
decodeBinaryFrame
(
ParsableByteArray
id3Data
,
int
frameSize
,
...
...
library/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Frame.java
View file @
3b34f850
...
@@ -15,8 +15,8 @@
...
@@ -15,8 +15,8 @@
*/
*/
package
com
.
google
.
android
.
exoplayer2
.
metadata
.
id3
;
package
com
.
google
.
android
.
exoplayer2
.
metadata
.
id3
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
com.google.android.exoplayer2.util.Assertions
;
/**
/**
* Base class for ID3 frames.
* Base class for ID3 frames.
...
@@ -29,11 +29,7 @@ public abstract class Id3Frame implements Parcelable {
...
@@ -29,11 +29,7 @@ public abstract class Id3Frame implements Parcelable {
public
final
String
id
;
public
final
String
id
;
public
Id3Frame
(
String
id
)
{
public
Id3Frame
(
String
id
)
{
this
.
id
=
id
;
this
.
id
=
Assertions
.
checkNotNull
(
id
);
}
protected
Id3Frame
(
Parcel
in
)
{
id
=
in
.
readString
();
}
}
@Override
@Override
...
...
library/src/main/java/com/google/android/exoplayer2/metadata/id3/PrivFrame.java
View file @
3b34f850
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
import
android.os.Parcel
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
com.google.android.exoplayer2.util.Util
;
import
java.util.Arrays
;
import
java.util.Arrays
;
/**
/**
...
@@ -35,27 +36,27 @@ public final class PrivFrame extends Id3Frame {
...
@@ -35,27 +36,27 @@ public final class PrivFrame extends Id3Frame {
this
.
privateData
=
privateData
;
this
.
privateData
=
privateData
;
}
}
public
PrivFrame
(
Parcel
in
)
{
/* package */
PrivFrame
(
Parcel
in
)
{
super
(
in
);
super
(
ID
);
owner
=
in
.
readString
();
owner
=
in
.
readString
();
privateData
=
in
.
createByteArray
();
privateData
=
in
.
createByteArray
();
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
o
bj
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
o
bj
)
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
fals
e
;
return
tru
e
;
}
PrivFrame
that
=
(
PrivFrame
)
o
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
return
false
;
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
}
if
(
owner
!=
null
?
!
owner
.
equals
(
that
.
owner
)
:
that
.
owner
!=
null
)
return
false
;
PrivFrame
other
=
(
PrivFrame
)
obj
;
return
Arrays
.
equals
(
privateData
,
that
.
privateData
);
return
Util
.
areEqual
(
owner
,
other
.
owner
)
&&
Arrays
.
equals
(
privateData
,
other
.
privateData
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
result
=
id
!=
null
?
id
.
hashCode
()
:
0
;
int
result
=
17
;
result
=
31
*
result
+
(
owner
!=
null
?
owner
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
owner
!=
null
?
owner
.
hashCode
()
:
0
);
result
=
31
*
result
+
Arrays
.
hashCode
(
privateData
);
result
=
31
*
result
+
Arrays
.
hashCode
(
privateData
);
return
result
;
return
result
;
...
@@ -63,24 +64,22 @@ public final class PrivFrame extends Id3Frame {
...
@@ -63,24 +64,22 @@ public final class PrivFrame extends Id3Frame {
@Override
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
id
);
dest
.
writeString
(
owner
);
dest
.
writeString
(
owner
);
dest
.
writeByteArray
(
privateData
);
dest
.
writeByteArray
(
privateData
);
}
}
public
static
final
Parcelable
.
Creator
<
PrivFrame
>
CREATOR
=
public
static
final
Parcelable
.
Creator
<
PrivFrame
>
CREATOR
=
new
Parcelable
.
Creator
<
PrivFrame
>()
{
new
Parcelable
.
Creator
<
PrivFrame
>()
{
@Override
@Override
public
PrivFrame
createFromParcel
(
Parcel
in
)
{
public
PrivFrame
createFromParcel
(
Parcel
in
)
{
return
new
PrivFrame
(
in
);
return
new
PrivFrame
(
in
);
}
}
@Override
@Override
public
PrivFrame
[]
newArray
(
int
size
)
{
public
PrivFrame
[]
newArray
(
int
size
)
{
return
new
PrivFrame
[
size
];
return
new
PrivFrame
[
size
];
}
}
};
};
}
}
library/src/main/java/com/google/android/exoplayer2/metadata/id3/TextInformationFrame.java
View file @
3b34f850
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
import
android.os.Parcel
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
com.google.android.exoplayer2.util.Util
;
/**
/**
* Text information ("T000" - "TZZZ", excluding "TXXX") ID3 frame.
* Text information ("T000" - "TZZZ", excluding "TXXX") ID3 frame.
...
@@ -30,25 +31,27 @@ public final class TextInformationFrame extends Id3Frame {
...
@@ -30,25 +31,27 @@ public final class TextInformationFrame extends Id3Frame {
this
.
description
=
description
;
this
.
description
=
description
;
}
}
public
TextInformationFrame
(
Parcel
in
)
{
/* package */
TextInformationFrame
(
Parcel
in
)
{
super
(
in
);
super
(
in
.
readString
()
);
description
=
in
.
readString
();
description
=
in
.
readString
();
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
obj
)
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
return
true
;
}
TextInformationFrame
that
=
(
TextInformationFrame
)
o
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
return
false
;
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
}
return
description
!=
null
?
description
.
equals
(
that
.
description
)
:
that
.
description
==
null
;
TextInformationFrame
other
=
(
TextInformationFrame
)
obj
;
return
id
.
equals
(
other
.
id
)
&&
Util
.
areEqual
(
description
,
other
.
description
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
result
=
id
!=
null
?
id
.
hashCode
()
:
0
;
int
result
=
17
;
result
=
31
*
result
+
id
.
hashCode
();
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
return
result
;
return
result
;
}
}
...
...
library/src/main/java/com/google/android/exoplayer2/metadata/id3/TxxxFrame.java
View file @
3b34f850
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
...
@@ -17,6 +17,7 @@ package com.google.android.exoplayer2.metadata.id3;
import
android.os.Parcel
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
com.google.android.exoplayer2.util.Util
;
/**
/**
* TXXX (User defined text information) ID3 frame.
* TXXX (User defined text information) ID3 frame.
...
@@ -34,28 +35,27 @@ public final class TxxxFrame extends Id3Frame {
...
@@ -34,28 +35,27 @@ public final class TxxxFrame extends Id3Frame {
this
.
value
=
value
;
this
.
value
=
value
;
}
}
public
TxxxFrame
(
Parcel
in
)
{
/* package */
TxxxFrame
(
Parcel
in
)
{
super
(
in
);
super
(
ID
);
description
=
in
.
readString
();
description
=
in
.
readString
();
value
=
in
.
readString
();
value
=
in
.
readString
();
}
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
o
)
return
true
;
if
(
this
==
obj
)
{
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
return
true
;
}
TxxxFrame
that
=
(
TxxxFrame
)
o
;
if
(
obj
==
null
||
getClass
()
!=
obj
.
getClass
())
{
if
(
id
!=
null
?
!
id
.
equals
(
that
.
id
)
:
that
.
id
!=
null
)
return
false
;
if
(
description
!=
null
?
!
description
.
equals
(
that
.
description
)
:
that
.
description
!=
null
)
return
false
;
return
false
;
return
value
!=
null
?
value
.
equals
(
that
.
value
)
:
that
.
value
==
null
;
}
TxxxFrame
other
=
(
TxxxFrame
)
obj
;
return
Util
.
areEqual
(
description
,
other
.
description
)
&&
Util
.
areEqual
(
value
,
other
.
value
);
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
int
result
=
id
!=
null
?
id
.
hashCode
()
:
0
;
int
result
=
17
;
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
description
!=
null
?
description
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
value
!=
null
?
value
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
value
!=
null
?
value
.
hashCode
()
:
0
);
return
result
;
return
result
;
...
@@ -63,24 +63,22 @@ public final class TxxxFrame extends Id3Frame {
...
@@ -63,24 +63,22 @@ public final class TxxxFrame extends Id3Frame {
@Override
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeString
(
id
);
dest
.
writeString
(
description
);
dest
.
writeString
(
description
);
dest
.
writeString
(
value
);
dest
.
writeString
(
value
);
}
}
public
static
final
Parcelable
.
Creator
<
TxxxFrame
>
CREATOR
=
public
static
final
Parcelable
.
Creator
<
TxxxFrame
>
CREATOR
=
new
Parcelable
.
Creator
<
TxxxFrame
>()
{
new
Parcelable
.
Creator
<
TxxxFrame
>()
{
@Override
@Override
public
TxxxFrame
createFromParcel
(
Parcel
in
)
{
public
TxxxFrame
createFromParcel
(
Parcel
in
)
{
return
new
TxxxFrame
(
in
);
return
new
TxxxFrame
(
in
);
}
}
@Override
@Override
public
TxxxFrame
[]
newArray
(
int
size
)
{
public
TxxxFrame
[]
newArray
(
int
size
)
{
return
new
TxxxFrame
[
size
];
return
new
TxxxFrame
[
size
];
}
}
};
};
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment