1 /* 2 * Copyright 2011 castLabs, Berlin 3 * 4 * Licensed under the Apache License, Version 2.0 (the License); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an AS IS BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.googlecode.mp4parser.boxes.mp4.objectdescriptors; 18 19 import com.coremedia.iso.IsoTypeReader; 20 21 import java.io.IOException; 22 import java.nio.ByteBuffer; 23 24 /** 25 * class ProfileLevelIndicationIndexDescriptor () extends BaseDescriptor 26 * : bit(8) ProfileLevelIndicationIndexDescrTag { 27 * bit(8) profileLevelIndicationIndex; 28 * } 29 */ 30 @Descriptor(tags = 0x14) 31 public class ProfileLevelIndicationDescriptor extends BaseDescriptor { 32 int profileLevelIndicationIndex; 33 34 @Override parseDetail( ByteBuffer bb)35 public void parseDetail( ByteBuffer bb) throws IOException { 36 profileLevelIndicationIndex = IsoTypeReader.readUInt8(bb); 37 } 38 39 @Override toString()40 public String toString() { 41 final StringBuilder sb = new StringBuilder(); 42 sb.append("ProfileLevelIndicationDescriptor"); 43 sb.append("{profileLevelIndicationIndex=").append(Integer.toHexString(profileLevelIndicationIndex)); 44 sb.append('}'); 45 return sb.toString(); 46 } 47 48 @Override equals(Object o)49 public boolean equals(Object o) { 50 if (this == o) { 51 return true; 52 } 53 if (o == null || getClass() != o.getClass()) { 54 return false; 55 } 56 57 ProfileLevelIndicationDescriptor that = (ProfileLevelIndicationDescriptor) o; 58 59 if (profileLevelIndicationIndex != that.profileLevelIndicationIndex) { 60 return false; 61 } 62 63 return true; 64 } 65 66 @Override hashCode()67 public int hashCode() { 68 return profileLevelIndicationIndex; 69 } 70 } 71