1/*
2Copyright (c) 2011 Stanislav Vitvitskiy
3
4Permission is hereby granted, free of charge, to any person obtaining a copy of this
5software and associated documentation files (the "Software"), to deal in the Software
6without restriction, including without limitation the rights to use, copy, modify,
7merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8permit persons to whom the Software is furnished to do so, subject to the following
9conditions:
10
11The above copyright notice and this permission notice shall be included in all copies or
12substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
18TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19OR OTHER DEALINGS IN THE SOFTWARE.
20*/
21package com.googlecode.mp4parser.h264.model;
22
23/**
24 * Aspect ratio
25 * <p/>
26 * dynamic enum
27 *
28 * @author Stanislav Vitvitskiy
29 */
30public class AspectRatio {
31
32    public static final AspectRatio Extended_SAR = new AspectRatio(255);
33
34    private int value;
35
36    private AspectRatio(int value) {
37        this.value = value;
38    }
39
40    public static AspectRatio fromValue(int value) {
41        if (value == Extended_SAR.value) {
42            return Extended_SAR;
43        }
44        return new AspectRatio(value);
45    }
46
47    public int getValue() {
48        return value;
49    }
50}
51