Coverage Report - org.jaudiotagger.tag.mp4.Mp4Tag
 
Classes in this File Line Coverage Branch Coverage Complexity
Mp4Tag
80%
115/143
31%
29/93
0
Mp4Tag$1
100%
1/1
N/A
0
 
 1  
 /*
 2  
  * Entagged Audio Tag library
 3  
  * Copyright (c) 2003-2005 Rapha�l Slinckx <raphael@slinckx.net>
 4  
  * 
 5  
  * This library is free software; you can redistribute it and/or
 6  
  * modify it under the terms of the GNU Lesser General Public
 7  
  * License as published by the Free Software Foundation; either
 8  
  * version 2.1 of the License, or (at your option) any later version.
 9  
  *  
 10  
  * This library is distributed in the hope that it will be useful,
 11  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13  
  * Lesser General Public License for more details.
 14  
  * 
 15  
  * You should have received a copy of the GNU Lesser General Public
 16  
  * License along with this library; if not, write to the Free Software
 17  
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 18  
  */
 19  
 package org.jaudiotagger.tag.mp4;
 20  
 
 21  
 import org.jaudiotagger.audio.generic.AbstractTag;
 22  
 import org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader;
 23  
 import org.jaudiotagger.logging.ErrorMessage;
 24  
 import org.jaudiotagger.tag.FieldDataInvalidException;
 25  
 import org.jaudiotagger.tag.KeyNotFoundException;
 26  
 import org.jaudiotagger.tag.TagField;
 27  
 import org.jaudiotagger.tag.TagFieldKey;
 28  
 import org.jaudiotagger.tag.datatype.Artwork;
 29  
 import static org.jaudiotagger.tag.mp4.Mp4FieldKey.*;
 30  
 import org.jaudiotagger.tag.mp4.field.*;
 31  
 
 32  
 import java.util.EnumMap;
 33  
 import java.util.List;
 34  
 import java.util.ArrayList;
 35  
 
 36  
 /**
 37  
  * A Logical representation of Mp4Tag, i.e the meta information stored in an Mp4 file underneath the
 38  
  * moov.udt.meta.ilst atom.
 39  
  */
 40  117
 public class Mp4Tag extends AbstractTag
 41  
 {
 42  
 
 43  17
     static EnumMap<TagFieldKey, Mp4FieldKey> tagFieldToMp4Field = new EnumMap<TagFieldKey, Mp4FieldKey>(TagFieldKey.class);
 44  
 
 45  
     //Mapping from generic key to mp4 key
 46  
     static
 47  
     {
 48  17
         tagFieldToMp4Field.put(TagFieldKey.ARTIST, Mp4FieldKey.ARTIST);
 49  17
         tagFieldToMp4Field.put(TagFieldKey.ALBUM, Mp4FieldKey.ALBUM);
 50  17
         tagFieldToMp4Field.put(TagFieldKey.TITLE, Mp4FieldKey.TITLE);
 51  17
         tagFieldToMp4Field.put(TagFieldKey.TRACK, Mp4FieldKey.TRACK);
 52  17
         tagFieldToMp4Field.put(TagFieldKey.YEAR, Mp4FieldKey.DAY);
 53  17
         tagFieldToMp4Field.put(TagFieldKey.GENRE, Mp4FieldKey.GENRE);
 54  17
         tagFieldToMp4Field.put(TagFieldKey.COMMENT, Mp4FieldKey.COMMENT);
 55  17
         tagFieldToMp4Field.put(TagFieldKey.ALBUM_ARTIST, Mp4FieldKey.ALBUM_ARTIST);
 56  17
         tagFieldToMp4Field.put(TagFieldKey.COMPOSER, Mp4FieldKey.COMPOSER);
 57  17
         tagFieldToMp4Field.put(TagFieldKey.GROUPING, Mp4FieldKey.GROUPING);
 58  17
         tagFieldToMp4Field.put(TagFieldKey.DISC_NO, Mp4FieldKey.DISCNUMBER);
 59  17
         tagFieldToMp4Field.put(TagFieldKey.BPM, Mp4FieldKey.BPM);
 60  17
         tagFieldToMp4Field.put(TagFieldKey.ENCODER, Mp4FieldKey.ENCODER);
 61  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_ARTISTID, Mp4FieldKey.MUSICBRAINZ_ARTISTID);
 62  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_RELEASEID, Mp4FieldKey.MUSICBRAINZ_ALBUMID);
 63  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_RELEASEARTISTID, Mp4FieldKey.MUSICBRAINZ_ALBUMARTISTID);
 64  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_TRACK_ID, Mp4FieldKey.MUSICBRAINZ_TRACKID);
 65  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_DISC_ID, Mp4FieldKey.MUSICBRAINZ_DISCID);
 66  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICIP_ID, Mp4FieldKey.MUSICIP_PUID);
 67  17
         tagFieldToMp4Field.put(TagFieldKey.AMAZON_ID, Mp4FieldKey.ASIN);
 68  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_RELEASE_STATUS, Mp4FieldKey.MUSICBRAINZ_ALBUM_STATUS);
 69  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_RELEASE_TYPE, Mp4FieldKey.MUSICBRAINZ_ALBUM_TYPE);
 70  17
         tagFieldToMp4Field.put(TagFieldKey.MUSICBRAINZ_RELEASE_COUNTRY, Mp4FieldKey.RELEASECOUNTRY);
 71  17
         tagFieldToMp4Field.put(TagFieldKey.LYRICS, Mp4FieldKey.LYRICS);
 72  17
         tagFieldToMp4Field.put(TagFieldKey.IS_COMPILATION, Mp4FieldKey.COMPILATION);
 73  17
         tagFieldToMp4Field.put(TagFieldKey.ARTIST_SORT, Mp4FieldKey.ARTIST_SORT);
 74  17
         tagFieldToMp4Field.put(TagFieldKey.ALBUM_ARTIST_SORT, Mp4FieldKey.ALBUM_ARTIST_SORT);
 75  17
         tagFieldToMp4Field.put(TagFieldKey.ALBUM_SORT, Mp4FieldKey.ALBUM_SORT);
 76  17
         tagFieldToMp4Field.put(TagFieldKey.TITLE_SORT, Mp4FieldKey.TITLE_SORT);
 77  17
         tagFieldToMp4Field.put(TagFieldKey.COMPOSER_SORT, Mp4FieldKey.COMPOSER_SORT);
 78  17
         tagFieldToMp4Field.put(TagFieldKey.COVER_ART, Mp4FieldKey.ARTWORK);
 79  17
         tagFieldToMp4Field.put(TagFieldKey.ISRC, Mp4FieldKey.ISRC);
 80  17
         tagFieldToMp4Field.put(TagFieldKey.CATALOG_NO, Mp4FieldKey.CATALOGNO);
 81  17
         tagFieldToMp4Field.put(TagFieldKey.BARCODE, Mp4FieldKey.BARCODE);
 82  17
         tagFieldToMp4Field.put(TagFieldKey.RECORD_LABEL, Mp4FieldKey.LABEL);
 83  17
         tagFieldToMp4Field.put(TagFieldKey.LYRICIST, Mp4FieldKey.LYRICIST);
 84  17
         tagFieldToMp4Field.put(TagFieldKey.CONDUCTOR, Mp4FieldKey.CONDUCTOR);
 85  17
         tagFieldToMp4Field.put(TagFieldKey.REMIXER, Mp4FieldKey.REMIXER);
 86  17
         tagFieldToMp4Field.put(TagFieldKey.MOOD, Mp4FieldKey.MOOD);
 87  17
         tagFieldToMp4Field.put(TagFieldKey.MEDIA, Mp4FieldKey.MEDIA);
 88  17
         tagFieldToMp4Field.put(TagFieldKey.URL_OFFICIAL_RELEASE_SITE, Mp4FieldKey.URL_OFFICIAL_RELEASE_SITE);
 89  17
         tagFieldToMp4Field.put(TagFieldKey.URL_DISCOGS_RELEASE_SITE, Mp4FieldKey.URL_DISCOGS_RELEASE_SITE);
 90  17
         tagFieldToMp4Field.put(TagFieldKey.URL_WIKIPEDIA_RELEASE_SITE, Mp4FieldKey.URL_WIKIPEDIA_RELEASE_SITE);
 91  17
         tagFieldToMp4Field.put(TagFieldKey.URL_OFFICIAL_ARTIST_SITE, Mp4FieldKey.URL_OFFICIAL_ARTIST_SITE);
 92  17
         tagFieldToMp4Field.put(TagFieldKey.URL_DISCOGS_ARTIST_SITE, Mp4FieldKey.URL_DISCOGS_ARTIST_SITE);
 93  17
         tagFieldToMp4Field.put(TagFieldKey.URL_WIKIPEDIA_ARTIST_SITE, Mp4FieldKey.URL_WIKIPEDIA_ARTIST_SITE);
 94  17
         tagFieldToMp4Field.put(TagFieldKey.LANGUAGE, Mp4FieldKey.LANGUAGE);
 95  17
         tagFieldToMp4Field.put(TagFieldKey.KEY, Mp4FieldKey.KEY);
 96  17
     }
 97  
 
 98  
     protected String getArtistId()
 99  
     {
 100  65
         return ARTIST.getFieldName();
 101  
     }
 102  
 
 103  
     protected String getAlbumId()
 104  
     {
 105  57
         return ALBUM.getFieldName();
 106  
     }
 107  
 
 108  
     protected String getTitleId()
 109  
     {
 110  43
         return TITLE.getFieldName();
 111  
     }
 112  
 
 113  
     protected String getTrackId()
 114  
     {
 115  18
         return TRACK.getFieldName();
 116  
     }
 117  
 
 118  
     protected String getYearId()
 119  
     {
 120  28
         return DAY.getFieldName();
 121  
     }
 122  
 
 123  
     protected String getCommentId()
 124  
     {
 125  18
         return COMMENT.getFieldName();
 126  
     }
 127  
 
 128  
     protected String getGenreId()
 129  
     {
 130  0
         return GENRE.getFieldName();
 131  
     }
 132  
 
 133  
     /**
 134  
      * There are two genres fields in mp4 files, but only one can be used at a time, so this method tries to make
 135  
      * things easier by checking both and returning the populated one (if any)
 136  
      */
 137  
     @Override
 138  
     public List<TagField> getGenre()
 139  
     {
 140  24
         List<TagField> genres = get(GENRE.getFieldName());
 141  24
         if (genres.size() == 0)
 142  
         {
 143  20
             genres = get(GENRE_CUSTOM.getFieldName());
 144  
         }
 145  24
         return genres;
 146  
     }
 147  
 
 148  
     public TagField createArtistField(String content)
 149  
     {
 150  28
         if (content == null)
 151  
         {
 152  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 153  
         }
 154  28
         return new Mp4TagTextField(getArtistId(), content);
 155  
     }
 156  
 
 157  
     public TagField createAlbumField(String content)
 158  
     {
 159  25
         if (content == null)
 160  
         {
 161  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 162  
         }
 163  25
         return new Mp4TagTextField(getAlbumId(), content);
 164  
     }
 165  
 
 166  
     public TagField createTitleField(String content)
 167  
     {
 168  13
         if (content == null)
 169  
         {
 170  1
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 171  
         }
 172  12
         return new Mp4TagTextField(getTitleId(), content);
 173  
     }
 174  
 
 175  
     public TagField createTrackField(String content) throws FieldDataInvalidException
 176  
     {
 177  2
         if (content == null)
 178  
         {
 179  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 180  
         }
 181  2
         return new Mp4TrackField(content);
 182  
     }
 183  
 
 184  
     public TagField createYearField(String content)
 185  
     {
 186  5
         if (content == null)
 187  
         {
 188  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 189  
         }
 190  5
         return new Mp4TagTextField(getYearId(), content);
 191  
     }
 192  
 
 193  
     public TagField createCommentField(String content)
 194  
     {
 195  2
         if (content == null)
 196  
         {
 197  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 198  
         }
 199  2
         return new Mp4TagTextField(getCommentId(), content);
 200  
     }
 201  
 
 202  
     /**
 203  
      * Create genre field
 204  
      * <p/>
 205  
      * <p>If the content can be parsed to one of the known values use the genre field otherwise
 206  
      * use the custom field.
 207  
      *
 208  
      * @param content
 209  
      * @return
 210  
      */
 211  
     @Override
 212  
     public TagField createGenreField(String content)
 213  
     {
 214  16
         if (content == null)
 215  
         {
 216  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 217  
         }
 218  16
         if (Mp4GenreField.isValidGenre(content))
 219  
         {
 220  9
             return new Mp4GenreField(content);
 221  
         }
 222  
         else
 223  
         {
 224  7
             return new Mp4TagTextField(GENRE_CUSTOM.getFieldName(), content);
 225  
         }
 226  
     }
 227  
 
 228  
     protected boolean isAllowedEncoding(String enc)
 229  
     {
 230  0
         return enc.equals(Mp4BoxHeader.CHARSET_UTF_8);
 231  
     }
 232  
 
 233  
     public String toString()
 234  
     {
 235  40
         return "Mpeg4 " + super.toString();
 236  
     }
 237  
 
 238  
 
 239  
     /**
 240  
      * Maps the generic key to the mp4 key and return the list of values for this field
 241  
      *
 242  
      * @param genericKey
 243  
      */
 244  
     @Override
 245  
     public List<TagField> get(TagFieldKey genericKey) throws KeyNotFoundException
 246  
     {
 247  31
         if (genericKey == null)
 248  
         {
 249  0
             throw new KeyNotFoundException();
 250  
         }
 251  31
         return super.get(tagFieldToMp4Field.get(genericKey).getFieldName());
 252  
     }
 253  
 
 254  
 
 255  
     /**
 256  
      * Retrieve the  values that exists for this mp4keyId (this is the internalid actually used)
 257  
      * <p/>
 258  
      *
 259  
      * @param mp4FieldKey
 260  
      */
 261  
     public List<TagField> get(Mp4FieldKey mp4FieldKey) throws KeyNotFoundException
 262  
     {
 263  171
         if (mp4FieldKey == null)
 264  
         {
 265  0
             throw new KeyNotFoundException();
 266  
         }
 267  171
         return super.get(mp4FieldKey.getFieldName());
 268  
     }
 269  
 
 270  
     /**
 271  
      * Retrieve the first value that exists for this generic key
 272  
      *
 273  
      * @param genericKey
 274  
      * @return
 275  
      */
 276  
     public String getFirst(TagFieldKey genericKey) throws KeyNotFoundException
 277  
     {
 278  524
         if (genericKey == null)
 279  
         {
 280  0
             throw new KeyNotFoundException();
 281  
         }
 282  524
         return super.getFirst(tagFieldToMp4Field.get(genericKey).getFieldName());
 283  
     }
 284  
 
 285  
     /**
 286  
      * Retrieve the first value that exists for this mp4key
 287  
      *
 288  
      * @param mp4Key
 289  
      * @return
 290  
      */
 291  
     public String getFirst(Mp4FieldKey mp4Key) throws KeyNotFoundException
 292  
     {
 293  558
         if (mp4Key == null)
 294  
         {
 295  0
             throw new KeyNotFoundException();
 296  
         }
 297  558
         return super.getFirst(mp4Key.getFieldName());
 298  
     }
 299  
 
 300  
     public Mp4TagField getFirstField(TagFieldKey genericKey) throws KeyNotFoundException
 301  
     {
 302  0
         if (genericKey == null)
 303  
         {
 304  0
             throw new KeyNotFoundException();
 305  
         }
 306  0
         return (Mp4TagField)super.getFirstField(tagFieldToMp4Field.get(genericKey).getFieldName());
 307  
     }
 308  
 
 309  
     public Mp4TagField getFirstField(Mp4FieldKey mp4Key) throws KeyNotFoundException
 310  
     {
 311  36
         if (mp4Key == null)
 312  
         {
 313  0
             throw new KeyNotFoundException();
 314  
         }
 315  36
         return (Mp4TagField) super.getFirstField(mp4Key.getFieldName());
 316  
     }
 317  
 
 318  
     /**
 319  
      * Delete fields with this generic key
 320  
      *
 321  
      * @param genericKey
 322  
      */
 323  
     public void deleteTagField(TagFieldKey genericKey) throws KeyNotFoundException
 324  
     {
 325  0
         if (genericKey == null)
 326  
         {
 327  0
             throw new KeyNotFoundException();
 328  
         }
 329  0
         super.deleteField(tagFieldToMp4Field.get(genericKey).getFieldName());
 330  0
     }
 331  
 
 332  
     /**
 333  
      * Delete fields with this mp4key
 334  
      *
 335  
      * @param mp4Key
 336  
      */
 337  
     public void deleteTagField(Mp4FieldKey mp4Key) throws KeyNotFoundException
 338  
     {
 339  4
         if (mp4Key == null)
 340  
         {
 341  0
             throw new KeyNotFoundException();
 342  
         }
 343  4
         super.deleteField(mp4Key.getFieldName());
 344  4
     }
 345  
 
 346  
     /**
 347  
      * Create discno field
 348  
      *
 349  
      * @param content can be any of the following
 350  
      *                1
 351  
      *                1/10
 352  
      * @return
 353  
      */
 354  
     public TagField createDiscNoField(String content) throws FieldDataInvalidException
 355  
     {
 356  0
         return new Mp4DiscNoField(content);
 357  
     }
 358  
 
 359  
     /**
 360  
      * Create artwork field
 361  
      *
 362  
      * @param data raw image data
 363  
      * @return
 364  
      */
 365  
     public TagField createArtworkField(byte[] data) throws FieldDataInvalidException
 366  
     {
 367  10
         return new Mp4TagCoverField(data);
 368  
     }
 369  
 
 370  
      /**
 371  
      * Create artwork field
 372  
      *    
 373  
      * @return
 374  
      */
 375  
     public TagField createArtworkField(Artwork artwork) throws FieldDataInvalidException
 376  
     {
 377  1
         return new Mp4TagCoverField(artwork.getBinaryData());
 378  
     }
 379  
 
 380  
     /**
 381  
      * Create Tag Field using generic key
 382  
      * <p/>
 383  
      * This should use the correct subclass for the key
 384  
      *
 385  
      * @param genericKey
 386  
      * @param value
 387  
      * @return
 388  
      * @throws KeyNotFoundException
 389  
      * @throws FieldDataInvalidException
 390  
      */
 391  
     @Override
 392  
     public TagField createTagField(TagFieldKey genericKey, String value) throws KeyNotFoundException, FieldDataInvalidException
 393  
     {
 394  139
         if (value == null)
 395  
         {
 396  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 397  
         }
 398  139
         if (genericKey == null)
 399  
         {
 400  0
             throw new KeyNotFoundException();
 401  
         }
 402  139
         return createTagField(tagFieldToMp4Field.get(genericKey), value);
 403  
     }
 404  
 
 405  
     /**
 406  
      * Create Tag Field using mp4 key
 407  
      * <p/>
 408  
      * Uses the correct subclass for the key
 409  
      *
 410  
      * @param mp4FieldKey
 411  
      * @param value
 412  
      * @return
 413  
      * @throws KeyNotFoundException
 414  
      * @throws FieldDataInvalidException
 415  
      */
 416  
     public TagField createTagField(Mp4FieldKey mp4FieldKey, String value) throws KeyNotFoundException, FieldDataInvalidException
 417  
 
 418  
     {
 419  141
         if (value == null)
 420  
         {
 421  0
             throw new IllegalArgumentException(ErrorMessage.GENERAL_INVALID_NULL_ARGUMENT.getMsg());
 422  
         }
 423  141
         if (mp4FieldKey == null)
 424  
         {
 425  0
             throw new KeyNotFoundException();
 426  
         }
 427  6
         switch (mp4FieldKey)
 428  
         {
 429  
             case BPM:
 430  
             case COMPILATION:
 431  
             case RATING:
 432  
             case CONTENT_TYPE:
 433  
             case TV_SEASON:
 434  
             case TV_EPISODE:
 435  9
                 return new Mp4TagByteField(mp4FieldKey, value, mp4FieldKey.getFieldLength());
 436  
 
 437  
             case GENRE:
 438  11
                 return createGenreField(value);
 439  
 
 440  
             case PODCAST_URL:
 441  
             case EPISODE_GLOBAL_ID:
 442  0
                 return new Mp4TagTextNumberField(mp4FieldKey.getFieldName(), value);
 443  
 
 444  
             case DISCNUMBER:
 445  6
                 return new Mp4DiscNoField(value);
 446  
 
 447  
             case TRACK:
 448  0
                 return new Mp4TrackField(value);
 449  
 
 450  
             case MUSICBRAINZ_TRACKID:
 451  
             case MUSICBRAINZ_ARTISTID:
 452  
             case MUSICBRAINZ_ALBUMID:
 453  
             case MUSICBRAINZ_ALBUMARTISTID:
 454  
             case MUSICBRAINZ_DISCID:
 455  
             case MUSICIP_PUID:
 456  
             case ASIN:
 457  
             case MUSICBRAINZ_ALBUM_STATUS:
 458  
             case MUSICBRAINZ_ALBUM_TYPE:
 459  
             case RELEASECOUNTRY:
 460  
             case PART_OF_GAPLESS_ALBUM:
 461  
             case ITUNES_SMPB:
 462  
             case ITUNES_NORM:
 463  
             case CDDB_1:
 464  
             case CDDB_TRACKNUMBER:
 465  
             case CDDB_IDS:
 466  
             case LYRICIST:
 467  
             case CONDUCTOR:
 468  
             case REMIXER:
 469  
             case ENGINEER:
 470  
             case PRODUCER:
 471  
             case DJMIXER:
 472  
             case MIXER:
 473  
             case MOOD:
 474  
             case ISRC:
 475  
             case MEDIA:
 476  
             case LABEL:
 477  
             case CATALOGNO:
 478  
             case BARCODE:
 479  
             case URL_OFFICIAL_RELEASE_SITE:
 480  
             case URL_DISCOGS_RELEASE_SITE:
 481  
             case URL_WIKIPEDIA_RELEASE_SITE:
 482  
             case URL_OFFICIAL_ARTIST_SITE:
 483  
             case URL_DISCOGS_ARTIST_SITE:
 484  
             case URL_WIKIPEDIA_ARTIST_SITE:
 485  
             case LANGUAGE:
 486  
             case KEY:                                        
 487  66
                 return new Mp4TagReverseDnsField(mp4FieldKey, value);
 488  
 
 489  
             default:
 490  166
                 return new Mp4TagTextField(mp4FieldKey.getFieldName(), value);
 491  
         }
 492  
     }
 493  
 
 494  
     public List<Artwork> getArtworkList()
 495  
     {
 496  6
         List<TagField> coverartList = get(Mp4FieldKey.ARTWORK);
 497  6
         List<Artwork> artworkList = new ArrayList<Artwork>(coverartList.size());
 498  
 
 499  6
         for(TagField next:coverartList)
 500  
         {
 501  6
             Mp4TagCoverField mp4CoverArt = (Mp4TagCoverField)next;
 502  6
             Artwork artwork = new Artwork();
 503  6
             artwork.setBinaryData(mp4CoverArt.getData());
 504  6
             artwork.setMimeType(Mp4TagCoverField.getMimeTypeForImageType(mp4CoverArt.getFieldType()));
 505  6
             artworkList.add(artwork);
 506  6
         }
 507  6
         return artworkList;
 508  
     }
 509  
 
 510  
 
 511  
 }