text:
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
using Avalonia.Media;
using AvaloniaEdit.Utils;

namespace AvaloniaEdit.Highlighting
{
    /// <summary>
    /// A highlighting color is a set of font properties and foreground and background color.
    /// </summary>
    public class HighlightingColor : IFreezable, ICloneable, IEquatable<HighlightingColor>
    {
        internal static readonly HighlightingColor Empty = FreezableHelper.FreezeAndReturn(new HighlightingColor());

        private string _name;
        private FontWeight? _fontWeight;
        private FontStyle? _fontStyle;
        private bool? _underline;
        private HighlightingBrush _foreground;
        private HighlightingBrush _background;

        /// <summary>
        /// Gets/Sets the name of the color.
        /// </summary>
        public string Name
        {
            get => _name;
            set
            {
                if (IsFrozen)
                    throw new InvalidOperationException();
                _name = value;
            }
        }

        /// <summary>
        /// Gets/sets the font weight. Null if the highlighting color does not change the font weight.
        /// </summary>
        public FontWeight? FontWeight
        {
            get => _fontWeight;
            set
            {
                if (IsFrozen)
                    throw new InvalidOperationException();
                _fontWeight = value;
            }
        }

        /// <summary>
        /// Gets/sets the font style. Null if the highlighting color does not change the font style.
        /// </summary>
        public FontStyle? FontStyle
        {
            get => _fontStyle;
            set
            {
                if (IsFrozen)
                    throw new InvalidOperationException();
                _fontStyle = value;
            }
        }

        /// <summary>
        ///  Gets/sets the underline flag. Null if the underline status does not change the font style.
        /// </summary>
        public bool? Underline
        {
            get => _underline;
            set
            {
                if (IsFrozen)
                    throw new InvalidOperationException();
                _underline = value;
            }
        }

        /// <summary>
        /// Gets/sets the foreground color applied by the highlighting.
        /// </summary>
        public HighlightingBrush Foreground
        {
            get => _foreground;
            set
            {
                if (IsFrozen)
                    throw new InvalidOperationException();
                _foreground = value;
            }
        }

        /// <summary>
        /// Gets/sets the background color applied by the highlighting.
        /// </summary>
        public HighlightingBrush Background
        {
            get => _background;
            set
            {
                if (IsFrozen)
                    throw new InvalidOperationException();
                _background = value;
            }
        }

        ///// <summary>
        ///// Serializes this HighlightingColor instance.
        ///// </summary>
        //public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
        //{
        //	if (info == null)
        //		throw new ArgumentNullException("info");
        //	info.AddValue("Name", this.Name);
        //	info.AddValue("HasWeight", this.FontWeight.HasValue);
        //	if (this.FontWeight.HasValue)
        //		info.AddValue("Weight", this.FontWeight.Value.ToOpenTypeWeight());
        //	info.AddValue("HasStyle", this.FontStyle.HasValue);
        //	if (this.FontStyle.HasValue)
        //		info.AddValue("Style", this.FontStyle.Value.ToString());
        //	info.AddValue("HasUnderline", this.Underline.HasValue);
        //	if (this.Underline.HasValue)
        //		info.AddValue("Underline", this.Underline.Value);
        //	info.AddValue("Foreground", this.Foreground);
        //	info.AddValue("Background", this.Background);
        //}

        /// <summary>
        /// Gets CSS code for the color.
        /// </summary>
        [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "CSS usually uses lowercase, and all possible values are English-only")]
        public virtual string ToCss()
        {
            var b = new StringBuilder();
            var c = Foreground?.GetColor(null);
            if (c != null)
            {
                b.AppendFormat(CultureInfo.InvariantCulture, "color: #{0:x2}{1:x2}{2:x2}; ", c.Value.R, c.Value.G, c.Value.B);
            }
            if (FontWeight != null)
            {
                b.Append("font-weight: ");
                b.Append(FontWeight.Value.ToString().ToLowerInvariant());
                b.Append("; ");
            }
            if (FontStyle != null)
            {
                b.Append("font-style: ");
                b.Append(FontStyle.Value.ToString().ToLowerInvariant());
                b.Append("; ");
            }
            if (Underline != null)
            {
                b.Append("text-decoration: ");
                b.Append(Underline.Value ? "underline" : "none");
                b.Append("; ");
            }
            return b.ToString();
        }

        /// <inheritdoc/>
        public override string ToString()
        {
            return "[" + GetType().Name + " " + (string.IsNullOrEmpty(Name) ? ToCss() : Name) + "]";
        }

        /// <summary>
        /// Prevent further changes to this highlighting color.
        /// </summary>
        public virtual void Freeze()
        {
            IsFrozen = true;
        }

        /// <summary>
        /// Gets whether this HighlightingColor instance is frozen.
        /// </summary>
        public bool IsFrozen { get; private set; }

        /// <summary>
        /// Clones this highlighting color.
        /// If this color is frozen, the clone will be unfrozen.
        /// </summary>
        public virtual HighlightingColor Clone()
        {
            var c = (HighlightingColor)MemberwiseClone();
            c.IsFrozen = false;
            return c;
        }

        object ICloneable.Clone()
        {
            return Clone();
        }

        /// <inheritdoc/>
        public sealed override bool Equals(object obj)
        {
            return Equals(obj as HighlightingColor);
        }

        /// <inheritdoc/>
        public virtual bool Equals(HighlightingColor other)
        {
            if (other == null)
                return false;
            return _name == other._name && _fontWeight == other._fontWeight
                && _fontStyle == other._fontStyle && _underline == other._underline
                && Equals(_foreground, other._foreground) && Equals(_background, other._background);
        }

        /// <inheritdoc/>
        [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
        public override int GetHashCode()
        {
            var hashCode = 0;
            unchecked
            {
                if (_name != null)
                    hashCode += 1000000007 * _name.GetHashCode();
                hashCode += 1000000009 * _fontWeight.GetHashCode();
                hashCode += 1000000021 * _fontStyle.GetHashCode();
                if (_foreground != null)
                    hashCode += 1000000033 * _foreground.GetHashCode();
                if (_background != null)
                    hashCode += 1000000087 * _background.GetHashCode();
            }
            return hashCode;
        }

        /// <summary>
        /// Overwrites the properties in this HighlightingColor with those from the given color;
        /// but maintains the current values where the properties of the given color return <c>null</c>.
        /// </summary>
        public void MergeWith(HighlightingColor color)
        {
            FreezableHelper.ThrowIfFrozen(this);
            if (color._fontWeight != null)
                _fontWeight = color._fontWeight;
            if (color._fontStyle != null)
                _fontStyle = color._fontStyle;
            if (color._foreground != null)
                _foreground = color._foreground;
            if (color._background != null)
                _background = color._background;
            if (color._underline != null)
                _underline = color._underline;
        }

        internal bool IsEmptyForMerge => _fontWeight == null && _fontStyle == null && _underline == null
                                         && _foreground == null && _background == null;
    }
}


text:
package org.elasticsearch.script.mustache;

import com.github.mustachejava.MustacheFactory;

import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.script.TemplateScript;
import org.elasticsearch.script.Script;
import org.elasticsearch.test.ESTestCase;
import org.junit.Before;

import java.io.IOException;
import java.io.StringWriter;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import static org.hamcrest.Matchers.equalTo;

/**
 * Mustache based templating test
 */
public class MustacheScriptEngineTests extends ESTestCase {
    private MustacheScriptEngine qe;
    private MustacheFactory factory;

    @Before
    public void setup() {
        qe = new MustacheScriptEngine();
        factory = new CustomMustacheFactory();
    }

    public void testSimpleParameterReplace() {
        Map<String, String> compileParams = Collections.singletonMap("content_type", "application/json");
        {
            String template = "GET _search {\"query\": " + "{\"boosting\": {" + "\"positive\": {\"match\": {\"body\": \"gift\"}},"
                    + "\"negative\": {\"term\": {\"body\": {\"value\": \"solr\"}" + "}}, \"negative_boost\": {{boost_val}} } }}";
            Map<String, Object> vars = new HashMap<>();
            vars.put("boost_val", "0.3");
            String o = qe.compile(null, template, TemplateScript.CONTEXT, compileParams).newInstance(vars).execute();
            assertEquals("GET _search {\"query\": {\"boosting\": {\"positive\": {\"match\": {\"body\": \"gift\"}},"
                    + "\"negative\": {\"term\": {\"body\": {\"value\": \"solr\"}}}, \"negative_boost\": 0.3 } }}",
                    o);
        }
        {
            String template = "GET _search {\"query\": " + "{\"boosting\": {" + "\"positive\": {\"match\": {\"body\": \"gift\"}},"
                    + "\"negative\": {\"term\": {\"body\": {\"value\": \"{{body_val}}\"}" + "}}, \"negative_boost\": {{boost_val}} } }}";
            Map<String, Object> vars = new HashMap<>();
            vars.put("boost_val", "0.3");
            vars.put("body_val", "\"quick brown\"");
            String o = qe.compile(null, template, TemplateScript.CONTEXT, compileParams).newInstance(vars).execute();
            assertEquals("GET _search {\"query\": {\"boosting\": {\"positive\": {\"match\": {\"body\": \"gift\"}},"
                    + "\"negative\": {\"term\": {\"body\": {\"value\": \"\\\"quick brown\\\"\"}}}, \"negative_boost\": 0.3 } }}",
                    o);
        }
    }

    public void testSimple() throws IOException {
        String templateString =
                  "{"
                + "\"source\":{\"match_{{template}}\": {}},"
                + "\"params\":{\"template\":\"all\"}"
                + "}";
        XContentParser parser = createParser(JsonXContent.jsonXContent, templateString);
        Script script = Script.parse(parser);
        TemplateScript.Factory compiled = qe.compile(null, script.getIdOrCode(), TemplateScript.CONTEXT, Collections.emptyMap());
        TemplateScript TemplateScript = compiled.newInstance(script.getParams());
        assertThat(TemplateScript.execute(), equalTo("{\"match_all\":{}}"));
    }

    public void testParseTemplateAsSingleStringWithConditionalClause() throws IOException {
        String templateString =
                  "{"
                + "  \"source\" : \"{ \\\"match_{{#use_it}}{{template}}{{/use_it}}\\\":{} }\"," + "  \"params\":{"
                + "    \"template\":\"all\","
                + "    \"use_it\": true"
                + "  }"
                + "}";
        XContentParser parser = createParser(JsonXContent.jsonXContent, templateString);
        Script script = Script.parse(parser);
        TemplateScript.Factory compiled = qe.compile(null, script.getIdOrCode(), TemplateScript.CONTEXT, Collections.emptyMap());
        TemplateScript TemplateScript = compiled.newInstance(script.getParams());
        assertThat(TemplateScript.execute(), equalTo("{ \"match_all\":{} }"));
    }

    public void testEscapeJson() throws IOException {
        {
            StringWriter writer = new StringWriter();
            factory.encode("hello \n world", writer);
            assertThat(writer.toString(), equalTo("hello \\n world"));
        }
        {
            StringWriter writer = new StringWriter();
            factory.encode("\n", writer);
            assertThat(writer.toString(), equalTo("\\n"));
        }

        Character[] specialChars = new Character[]{
                '\"',
                '\\',
                '\u0000',
                '\u0001',
                '\u0002',
                '\u0003',
                '\u0004',
                '\u0005',
                '\u0006',
                '\u0007',
                '\u0008',
                '\u0009',
                '\u000B',
                '\u000C',
                '\u000E',
                '\u000F',
                '\u001F'};
        String[] escapedChars = new String[]{
                "\\\"",
                "\\\\",
                "\\u0000",
                "\\u0001",
                "\\u0002",
                "\\u0003",
                "\\u0004",
                "\\u0005",
                "\\u0006",
                "\\u0007",
                "\\u0008",
                "\\u0009",
                "\\u000B",
                "\\u000C",
                "\\u000E",
                "\\u000F",
                "\\u001F"};
        int iters = scaledRandomIntBetween(100, 1000);
        for (int i = 0; i < iters; i++) {
            int rounds = scaledRandomIntBetween(1, 20);
            StringWriter expect = new StringWriter();
            StringWriter writer = new StringWriter();
            for (int j = 0; j < rounds; j++) {
                String s = getChars();
                writer.write(s);
                expect.write(s);

                int charIndex = randomInt(7);
                writer.append(specialChars[charIndex]);
                expect.append(escapedChars[charIndex]);
            }
            StringWriter target = new StringWriter();
            factory.encode(writer.toString(), target);
            assertThat(expect.toString(), equalTo(target.toString()));
        }
    }

    private String getChars() {
        String string = randomRealisticUnicodeOfCodepointLengthBetween(0, 10);
        for (int i = 0; i < string.length(); i++) {
            if (isEscapeChar(string.charAt(i))) {
                return string.substring(0, i);
            }
        }
        return string;
    }

    /**
     * From https://www.ietf.org/rfc/rfc4627.txt:
     *
     * All Unicode characters may be placed within the
     * quotation marks except for the characters that must be escaped:
     * quotation mark, reverse solidus, and the control characters (U+0000
     * through U+001F).
     * */
    private static boolean isEscapeChar(char c) {
        switch (c) {
        case '"':
        case '\\':
            return true;
        }

        if (c < '\u002F')
            return true;
        return false;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.asit.data;

public class DataProviderException extends Exception {

	private static final long serialVersionUID = 5118006787657300217L;

	public DataProviderException(String message, Throwable cause) {
		super(message, cause);
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <stroke android:color="@color/red" android:width="0.5dp" />
    <solid android:color="@color/auto_color_000000_15" />
</shape>


text:
require 'spec_helper'

describe 'apache::mod::reqtimeout', type: :class do
  it_behaves_like 'a mod class, without including apache'
  context 'on a Debian OS' do
    include_examples 'Debian 11'

    context 'passing no parameters' do
      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$}) }
    end
    context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do
      let :params do
        { timeouts: ['header=20-60,minrate=600', 'body=60,minrate=600'] }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$}) }
    end
    context "passing timeouts => 'header=20-60,minrate=600'" do
      let :params do
        { timeouts: 'header=20-60,minrate=600' }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600$}) }
    end
  end
  context 'on a RedHat OS' do
    include_examples 'RedHat 6'

    context 'passing no parameters' do
      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$}) }
    end
    context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do
      let :params do
        { timeouts: ['header=20-60,minrate=600', 'body=60,minrate=600'] }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$}) }
    end
    context "passing timeouts => 'header=20-60,minrate=600'" do
      let :params do
        { timeouts: 'header=20-60,minrate=600' }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600$}) }
    end
  end
  context 'on a FreeBSD OS' do
    include_examples 'FreeBSD 9'

    context 'passing no parameters' do
      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$}) }
    end
    context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do
      let :params do
        { timeouts: ['header=20-60,minrate=600', 'body=60,minrate=600'] }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$}) }
    end
    context "passing timeouts => 'header=20-60,minrate=600'" do
      let :params do
        { timeouts: 'header=20-60,minrate=600' }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600$}) }
    end
  end
  context 'on a Gentoo OS' do
    include_examples 'Gentoo'

    context 'passing no parameters' do
      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-40,minrate=500\nRequestReadTimeout body=10,minrate=500$}) }
    end
    context "passing timeouts => ['header=20-60,minrate=600', 'body=60,minrate=600']" do
      let :params do
        { timeouts: ['header=20-60,minrate=600', 'body=60,minrate=600'] }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600\nRequestReadTimeout body=60,minrate=600$}) }
    end
    context "passing timeouts => 'header=20-60,minrate=600'" do
      let :params do
        { timeouts: 'header=20-60,minrate=600' }
      end

      it { is_expected.to contain_class('apache::params') }
      it { is_expected.to contain_apache__mod('reqtimeout') }
      it { is_expected.to contain_file('reqtimeout.conf').with_content(%r{^RequestReadTimeout header=20-60,minrate=600$}) }
    end
  end
end


text:
using FreshMvvm;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XrnCourse.BucketList.Domain.Services.Abstract;
using XrnCourse.BucketList.Domain.Services.Mock;
using XrnCourse.BucketList.Domain.Services.SQLite;
using XrnCourse.BucketList.ViewModels;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace XrnCourse.BucketList
{
    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();

            //FreshIOC.Container.Register<IAppSettingsService, AppSettingsInMemoryService>();
            //FreshIOC.Container.Register<IUsersService, UsersInMemoryService>();
            //FreshIOC.Container.Register<IBucketsService, BucketsInMemoryService>();
            FreshIOC.Container.Register<IAppSettingsService>(new AppSettingsSQLiteService());
            FreshIOC.Container.Register<IUsersService>(new UsersSQLiteService());
            FreshIOC.Container.Register<IBucketsService>(new BucketsSQLiteService());

            MainPage = new FreshNavigationContainer(FreshPageModelResolver.ResolvePageModel<MainViewModel>());
        }

        protected override void OnStart()
        {
            // Handle when your app starts
        }

        protected override void OnSleep()
        {
            // Handle when your app sleeps
        }

        protected override void OnResume()
        {
            // Handle when your app resumes
        }
    }
}


text:
<?php

namespace Just2\BackendBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JVJ\UserBundle\Entity\User;

/**
 * @ORM\Table(name="member")
 * @ORM\Entity()
 */
class Member {

    /**
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id()
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\OneToMany(targetEntity="DateJust", mappedBy="member")
     */
    protected $dateJusts;

    /**
     * @ORM\OneToMany(targetEntity="Bid", mappedBy="member")
     */
    protected $bids;

    /** @ORM\Column(type="string", length=255) */
    private $firstName;

    /** @ORM\Column(type="string", length=255) */
    private $lastName;

    /** @ORM\Column(type="string", length=255) */
    private $email;

    /** @ORM\Column(type="string", length=255) */
    private $street;

    /**
     * @ORM\ManyToOne(targetEntity="JVJ\UtilBundle\Entity\Department")
     */
    private $state;

    /** @ORM\Column(type="string", length=255) */
    private $postCode;

    /**
     * @ORM\ManyToOne(targetEntity="JVJ\UtilBundle\Entity\Country")
     */
    private $country;

    /** @ORM\Column(type="string", length=255) */
    private $phoneCode;

    /** @ORM\Column(type="string", length=255) */
    private $phone;

    /** @ORM\Column(type="string", length=255) */
    private $mobile;

    private $password;

    /** @ORM\Column(type="datetime")
     *
     * @Assert\DateTime
     */
    private $dateOfBirth;

    /** @ORM\Column(type="string", length=255) */
    private $gender;

    /**
     * @Assert\Type(type="JVJ\UserBundle\Entity\User")
     */
    private $user;

    private $userId;

    public function __toString()
    {
        return $this->getFirstName();
    }

    /**
     * Constructor
     */
    public function __construct() {
        $this->dates = new \Doctrine\Common\Collections\ArrayCollection();
        $this->bids = new \Doctrine\Common\Collections\ArrayCollection();
        $this->auctions = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Get dates
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getDates() {
        return $this->dates;
    }

    /**
     * Add bids
     *
     * @param \Just2\BackendBundle\Entity\Bid $bids
     * @return Member
     */
    public function addBid(\Just2\BackendBundle\Entity\Bid $bids) {
        $this->bids[] = $bids;

        return $this;
    }

    /**
     * Remove bids
     *
     * @param \Just2\BackendBundle\Entity\Bid $bids
     */
    public function removeBid(\Just2\BackendBundle\Entity\Bid $bids) {
        $this->bids->removeElement($bids);
    }

    /**
     * Get bids
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getBids() {
        return $this->bids;
    }

    /**
     * Add auctions
     *
     * @param \Just2\BackendBundle\Entity\auction $auctions
     * @return Member
     */
    public function addAuction(\Just2\BackendBundle\Entity\auction $auctions) {
        $this->auctions[] = $auctions;

        return $this;
    }

    /**
     * Remove auctions
     *
     * @param \Just2\BackendBundle\Entity\auction $auctions
     */
    public function removeAuction(\Just2\BackendBundle\Entity\auction $auctions) {
        $this->auctions->removeElement($auctions);
    }

    /**
     * Get auctions
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getAuctions() {
        return $this->auctions;
    }

    /**
     * Set firstName
     *
     * @param string $firstName
     * @return Member
     */
    public function setFirstName($firstName) {
        $this->firstName = $firstName;

        return $this;
    }

    /**
     * Get firstName
     *
     * @return string
     */
    public function getFirstName() {
        return $this->firstName;
    }

    /**
     * Set lastName
     *
     * @param string $lastName
     * @return Member
     */
    public function setLastName($lastName) {
        $this->lastName = $lastName;

        return $this;
    }

    /**
     * Get lastName
     *
     * @return string
     */
    public function getLastName() {
        return $this->lastName;
    }

    /**
     * Set email
     *
     * @param string $email
     * @return Member
     */
    public function setEmail($email) {
        $this->email = $email;

        return $this;
    }

    /**
     * Get email
     *
     * @return email
     */
    public function getEmail() {
        return $this->email;
    }

    /**
     * Set street
     *
     * @param string $street
     * @return Member
     */
    public function setStreet($street) {
        $this->street = $street;

        return $this;
    }

    /**
     * Get street
     *
     * @return string
     */
    public function getStreet() {
        return $this->street;
    }

    /**
     * Set postCode
     *
     * @param string $postCode
     * @return Member
     */
    public function setPostCode($postCode) {
        $this->postCode = $postCode;

        return $this;
    }

    /**
     * Get postCode
     *
     * @return string
     */
    public function getPostCode() {
        return $this->postCode;
    }

    /**
     * Set phoneCode
     *
     * @param string $phoneCode
     * @return Member
     */
    public function setPhoneCode($phoneCode) {
        $this->phoneCode = $phoneCode;

        return $this;
    }

    /**
     * Get phoneCode
     *
     * @return string
     */
    public function getPhoneCode() {
        return $this->phoneCode;
    }

    /**
     * Set phone
     *
     * @param string $phone
     * @return Member
     */
    public function setPhone($phone) {
        $this->phone = $phone;

        return $this;
    }

    /**
     * Get phone
     *
     * @return string
     */
    public function getPhone() {
        return $this->phone;
    }

    /**
     * Set mobile
     *
     * @param string $mobile
     * @return Member
     */
    public function setMobile($mobile) {
        $this->mobile = $mobile;

        return $this;
    }

    /**
     * Get mobile
     *
     * @return string
     */
    public function getMobile() {
        return $this->mobile;
    }

    /**
     * Set gender
     *
     * @param string $gender
     * @return Member
     */
    public function setGender($gender) {
        $this->gender = $gender;

        return $this;
    }

    /**
     * Get gender
     *
     * @return string
     */
    public function getGender() {
        return $this->gender;
    }

    /**
     * Set password
     *
     * @param string $password
     * @return Member
     */
    public function setPassword($password) {
        $this->password = $password;

        return $this;
    }

    /**
     * Get password
     *
     * @return string
     */
    public function getPassword() {
        return $this->password;
    }

    /**
     * Set state
     *
     * @param \JVJ\UtilBundle\Entity\Department $state
     * @return Member
     */
    public function setState(\JVJ\UtilBundle\Entity\Department $state = null) {
        $this->state = $state;

        return $this;
    }

    /**
     * Get state
     *
     * @return \JVJ\UtilBundle\Entity\Department
     */
    public function getState() {
        return $this->state;
    }

    /**
     * Set country
     *
     * @param \JVJ\UtilBundle\Entity\Country $country
     * @return Member
     */
    public function setCountry(\JVJ\UtilBundle\Entity\Country $country = null) {
        $this->country = $country;

        return $this;
    }

    /**
     * Get country
     *
     * @return \JVJ\UtilBundle\Entity\Country
     */
    public function getCountry() {
        return $this->country;
    }

    /**
     * Set dateOfBirth
     *
     * @param \DateTime $dateOfBirth
     * @return Member
     */
    public function setDateOfBirth($dateOfBirth) {
        $this->dateOfBirth = $dateOfBirth;

        return $this;
    }

    /**
     * Get dateOfBirth
     *
     * @return \DateTime
     */
    public function getDateOfBirth() {
        return $this->dateOfBirth;
    }

    /**
     * Add dateJusts
     *
     * @param \Just2\BackendBundle\Entity\DateJust $dateJusts
     * @return Member
     */
    public function addDateJust(\Just2\BackendBundle\Entity\DateJust $dateJusts) {
        $this->dateJusts[] = $dateJusts;

        return $this;
    }

    /**
     * Remove dateJusts
     *
     * @param \Just2\BackendBundle\Entity\DateJust $dateJusts
     */
    public function removeDateJust(\Just2\BackendBundle\Entity\DateJust $dateJusts) {
        $this->dateJusts->removeElement($dateJusts);
    }

    /**
     * Get dateJusts
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getDateJusts() {
        return $this->dateJusts;
    }

    /**
    * Set user
    *
    * @param string $userId
    * @return Member
    */
    public function setUserId($userId) {
        $this->userId = $userId;
    }

    /**
    * Get user
    *
    *
    * @return string
    */
    public function getUserId() {
        return $this->userId;
    }

    //Por definir variable $user

    /**
     * Set user
     *
     * @param string $user
     * @return Member
     */
    public function setUser(User $user) {
        $this->user = $user;
    }

    /**
     * Get user
     *
     * @return string
     */
    public function getUser() {
        return $this->user;
    }

}


text: {{item.title}}


text:
/*------------------------------------------------------------------------------

    Table of contents

     1. Include headers
     2. External compiler flags
     3. Module defines
     4. Local function prototypes
     5. Functions
          h264bsdDecodeSeiMessage
          DecodeBufferingPeriod
          DecodePictureTiming
          DecodePanScanRectangle
          DecodeFillerPayload
          DecodeUserDataRegisteredITuTT35
          DecodeUserDataUnregistered
          DecodeRecoveryPoint
          DecodeDecRefPicMarkingRepetition
          DecodeSparePic
          DecodeSceneInfo
          DecodeSubSeqInfo
          DecodeSubSeqLayerCharacteristics
          DecodeSubSeqCharacteristics
          DecodeFullFrameFreeze
          DecodeFullFrameSnapshot
          DecodeProgressiveRefinementSegmentStart
          DecodeProgressiveRefinementSegmentEnd
          DecodeMotionConstrainedSliceGroupSet
          DecodeReservedSeiMessage

------------------------------------------------------------------------------*/

/*------------------------------------------------------------------------------
    1. Include headers
------------------------------------------------------------------------------*/

#include "h264bsd_sei.h"
#include "basetype.h"
#include "h264bsd_util.h"
#include "h264bsd_stream.h"
#include "h264bsd_vlc.h"
#include "h264bsd_seq_param_set.h"
#include "h264bsd_slice_header.h"

/*------------------------------------------------------------------------------
    2. External compiler flags
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
    3. Module defines
------------------------------------------------------------------------------*/

static const u32 numClockTS[9] = {1,1,1,2,2,3,3,2,3};
static const u32 ceilLog2NumSliceGroups[9] = {0,1,1,2,2,3,3,3,3};

/*------------------------------------------------------------------------------
    4. Local function prototypes
------------------------------------------------------------------------------*/

static u32 DecodeBufferingPeriod(
  strmData_t *pStrmData,
  seiBufferingPeriod_t *pBufferingPeriod,
  u32 cpbCnt,
  u32 initialCpbRemovalDelayLength,
  u32 nalHrdBpPresentFlag,
  u32 vclHrdBpPresentFlag);

static u32 DecodePictureTiming(
  strmData_t *pStrmData,
  seiPicTiming_t *pPicTiming,
  u32 cpbRemovalDelayLength,
  u32 dpbOutputDelayLength,
  u32 timeOffsetLength,
  u32 cpbDpbDelaysPresentFlag,
  u32 picStructPresentFlag);

static u32 DecodePanScanRectangle(
  strmData_t *pStrmData,
  seiPanScanRect_t *pPanScanRectangle);

static u32 DecodeFillerPayload(strmData_t *pStrmData, u32 payloadSize);

static u32 DecodeUserDataRegisteredITuTT35(
  strmData_t *pStrmData,
  seiUserDataRegisteredItuTT35_t *pUserDataRegisteredItuTT35,
  u32 payloadSize);

static u32 DecodeUserDataUnregistered(
  strmData_t *pStrmData,
  seiUserDataUnregistered_t *pUserDataUnregistered,
  u32 payloadSize);

static u32 DecodeRecoveryPoint(
  strmData_t *pStrmData,
  seiRecoveryPoint_t *pRecoveryPoint);

static u32 DecodeDecRefPicMarkingRepetition(
  strmData_t *pStrmData,
  seiDecRefPicMarkingRepetition_t *pDecRefPicMarkingRepetition,
  u32 numRefFrames);

static u32 DecodeSparePic(
  strmData_t *pStrmData,
  seiSparePic_t *pSparePic,
  u32 picSizeInMapUnits);

static u32 DecodeSceneInfo(
  strmData_t *pStrmData,
  seiSceneInfo_t *pSceneInfo);

static u32 DecodeSubSeqInfo(
  strmData_t *pStrmData,
  seiSubSeqInfo_t *pSubSeqInfo);

static u32 DecodeSubSeqLayerCharacteristics(
  strmData_t *pStrmData,
  seiSubSeqLayerCharacteristics_t *pSubSeqLayerCharacteristics);

static u32 DecodeSubSeqCharacteristics(
  strmData_t *pStrmData,
  seiSubSeqCharacteristics_t *pSubSeqCharacteristics);

static u32 DecodeFullFrameFreeze(
  strmData_t *pStrmData,
  seiFullFrameFreeze_t *pFullFrameFreeze);

static u32 DecodeFullFrameSnapshot(
  strmData_t *pStrmData,
  seiFullFrameSnapshot_t *pFullFrameSnapshot);

static u32 DecodeProgressiveRefinementSegmentStart(
  strmData_t *pStrmData,
  seiProgressiveRefinementSegmentStart_t *pProgressiveRefinementSegmentStart);

static u32 DecodeProgressiveRefinementSegmentEnd(
  strmData_t *pStrmData,
  seiProgressiveRefinementSegmentEnd_t *pProgressiveRefinementSegmentEnd);

static u32 DecodeMotionConstrainedSliceGroupSet(
  strmData_t *pStrmData,
  seiMotionConstrainedSliceGroupSet_t *pMotionConstrainedSliceGroupSet,
  u32 numSliceGroups);

static u32 DecodeReservedSeiMessage(
  strmData_t *pStrmData,
  seiReservedSeiMessage_t *pReservedSeiMessage,
  u32 payloadSize);

/*------------------------------------------------------------------------------

    Function: h264bsdDecodeSeiMessage

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

u32 h264bsdDecodeSeiMessage(
  strmData_t *pStrmData,
  seqParamSet_t *pSeqParamSet,
  seiMessage_t *pSeiMessage,
  u32 numSliceGroups)
{

/* Variables */

    u32 tmp, payloadType, payloadSize, status;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pSeiMessage);

    H264SwDecMemset(pSeiMessage, 0, sizeof(seiMessage_t));

    do
    {
        payloadType = 0;
        while((tmp = h264bsdGetBits(pStrmData, 8)) == 0xFF)
        {
            payloadType += 255;
                    }
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        payloadType += tmp;

        payloadSize = 0;
        while((tmp = h264bsdGetBits(pStrmData, 8)) == 0xFF)
        {
            payloadSize += 255;
        }
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        payloadSize += tmp;

        pSeiMessage->payloadType = payloadType;

        switch (payloadType)
        {
            case 0:
                ASSERT(pSeqParamSet);
                status = DecodeBufferingPeriod(
                  pStrmData,
                  &pSeiMessage->bufferingPeriod,
                  pSeqParamSet->vuiParameters->vclHrdParameters.cpbCnt,
                  pSeqParamSet->vuiParameters->vclHrdParameters.
                  initialCpbRemovalDelayLength,
                  pSeqParamSet->vuiParameters->nalHrdParametersPresentFlag,
                  pSeqParamSet->vuiParameters->vclHrdParametersPresentFlag);
                break;

            case 1:
                ASSERT(pSeqParamSet->vuiParametersPresentFlag);
                status = DecodePictureTiming(
                  pStrmData,
                  &pSeiMessage->picTiming,
                  pSeqParamSet->vuiParameters->vclHrdParameters.
                      cpbRemovalDelayLength,
                  pSeqParamSet->vuiParameters->vclHrdParameters.
                      dpbOutputDelayLength,
                  pSeqParamSet->vuiParameters->vclHrdParameters.
                    timeOffsetLength,
                  pSeqParamSet->vuiParameters->nalHrdParametersPresentFlag ||
                  pSeqParamSet->vuiParameters->vclHrdParametersPresentFlag ?
                  HANTRO_TRUE : HANTRO_FALSE,
                  pSeqParamSet->vuiParameters->picStructPresentFlag);
                break;

            case 2:
                status = DecodePanScanRectangle(
                  pStrmData,
                  &pSeiMessage->panScanRect);
                break;

            case 3:
                status = DecodeFillerPayload(pStrmData, payloadSize);
                break;

            case 4:
                status = DecodeUserDataRegisteredITuTT35(
                  pStrmData,
                  &pSeiMessage->userDataRegisteredItuTT35,
                  payloadSize);
                break;

            case 5:
                status = DecodeUserDataUnregistered(
                  pStrmData,
                  &pSeiMessage->userDataUnregistered,
                  payloadSize);
                break;

            case 6:
                status = DecodeRecoveryPoint(
                  pStrmData,
                  &pSeiMessage->recoveryPoint);
                break;

            case 7:
                status = DecodeDecRefPicMarkingRepetition(
                  pStrmData,
                  &pSeiMessage->decRefPicMarkingRepetition,
                  pSeqParamSet->numRefFrames);
                break;

            case 8:
                ASSERT(pSeqParamSet);
                status = DecodeSparePic(
                  pStrmData,
                  &pSeiMessage->sparePic,
                  pSeqParamSet->picWidthInMbs * pSeqParamSet->picHeightInMbs);
                break;

            case 9:
                status = DecodeSceneInfo(
                  pStrmData,
                  &pSeiMessage->sceneInfo);
                break;

            case 10:
                status = DecodeSubSeqInfo(
                  pStrmData,
                  &pSeiMessage->subSeqInfo);
                break;

            case 11:
                status = DecodeSubSeqLayerCharacteristics(
                  pStrmData,
                  &pSeiMessage->subSeqLayerCharacteristics);
                break;

            case 12:
                status = DecodeSubSeqCharacteristics(
                  pStrmData,
                  &pSeiMessage->subSeqCharacteristics);
                break;

            case 13:
                status = DecodeFullFrameFreeze(
                  pStrmData,
                  &pSeiMessage->fullFrameFreeze);
                break;

            case 14: /* This SEI does not contain data, what to do ??? */
                status = HANTRO_OK;
                break;

            case 15:
                status = DecodeFullFrameSnapshot(
                  pStrmData,
                  &pSeiMessage->fullFrameSnapshot);
                break;

            case 16:
                status = DecodeProgressiveRefinementSegmentStart(
                  pStrmData,
                  &pSeiMessage->progressiveRefinementSegmentStart);
                break;

            case 17:
                status = DecodeProgressiveRefinementSegmentEnd(
                  pStrmData,
                  &pSeiMessage->progressiveRefinementSegmentEnd);
                break;

            case 18:
                ASSERT(numSliceGroups);
                status = DecodeMotionConstrainedSliceGroupSet(
                  pStrmData,
                  &pSeiMessage->motionConstrainedSliceGroupSet,
                  numSliceGroups);
                break;

            default:
                status = DecodeReservedSeiMessage(
                  pStrmData,
                  &pSeiMessage->reservedSeiMessage,
                  payloadSize);
                break;
        }

        if (status != HANTRO_OK)
            return(status);

        while (!h264bsdIsByteAligned(pStrmData))
        {
            if (h264bsdGetBits(pStrmData, 1) != 1)
                return(HANTRO_NOK);
            while (!h264bsdIsByteAligned(pStrmData))
            {
                if (h264bsdGetBits(pStrmData, 1) != 0)
                    return(HANTRO_NOK);
            }
        }
    } while (h264bsdMoreRbspData(pStrmData));

    return(h264bsdRbspTrailingBits(pStrmData));

}

/*------------------------------------------------------------------------------

    Function: DecodeBufferingPeriod

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeBufferingPeriod(
  strmData_t *pStrmData,
  seiBufferingPeriod_t *pBufferingPeriod,
  u32 cpbCnt,
  u32 initialCpbRemovalDelayLength,
  u32 nalHrdBpPresentFlag,
  u32 vclHrdBpPresentFlag)
{

/* Variables */

    u32 tmp, i;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pBufferingPeriod);
    ASSERT(cpbCnt);
    ASSERT(initialCpbRemovalDelayLength);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pBufferingPeriod->seqParameterSetId);
    if (tmp != HANTRO_OK)
        return(tmp);
    if (pBufferingPeriod->seqParameterSetId > 31)
        return(HANTRO_NOK);

    if (nalHrdBpPresentFlag)
    {
        for (i = 0; i < cpbCnt; i++)
        {
            tmp = h264bsdGetBits(pStrmData, initialCpbRemovalDelayLength);
            if (tmp == END_OF_STREAM)
                return(HANTRO_NOK);
            if (tmp == 0)
                return(HANTRO_NOK);
            pBufferingPeriod->initialCpbRemovalDelay[i] = tmp;

            tmp = h264bsdGetBits(pStrmData, initialCpbRemovalDelayLength);
            if (tmp == END_OF_STREAM)
                return(HANTRO_NOK);
            pBufferingPeriod->initialCpbRemovalDelayOffset[i] = tmp;
        }
    }

    if (vclHrdBpPresentFlag)
    {
        for (i = 0; i < cpbCnt; i++)
        {
            tmp = h264bsdGetBits(pStrmData, initialCpbRemovalDelayLength);
            if (tmp == END_OF_STREAM)
                return(HANTRO_NOK);
            pBufferingPeriod->initialCpbRemovalDelay[i] = tmp;

            tmp = h264bsdGetBits(pStrmData, initialCpbRemovalDelayLength);
            if (tmp == END_OF_STREAM)
                return(HANTRO_NOK);
            pBufferingPeriod->initialCpbRemovalDelayOffset[i] = tmp;
        }
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodePictureTiming

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodePictureTiming(
  strmData_t *pStrmData,
  seiPicTiming_t *pPicTiming,
  u32 cpbRemovalDelayLength,
  u32 dpbOutputDelayLength,
  u32 timeOffsetLength,
  u32 cpbDpbDelaysPresentFlag,
  u32 picStructPresentFlag)
{

/* Variables */

    u32 tmp, i;
    i32 itmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pPicTiming);

    if (cpbDpbDelaysPresentFlag)
    {
        tmp = h264bsdGetBits(pStrmData, cpbRemovalDelayLength);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pPicTiming->cpbRemovalDelay = tmp;

        tmp = h264bsdGetBits(pStrmData, dpbOutputDelayLength);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pPicTiming->dpbOutputDelay = tmp;
    }

    if (picStructPresentFlag)
    {
        tmp = h264bsdGetBits(pStrmData, 4);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        if (tmp > 8)
            return(HANTRO_NOK);
        pPicTiming->picStruct = tmp;

        for (i = 0; i < numClockTS[pPicTiming->picStruct]; i++)
        {
            tmp = h264bsdGetBits(pStrmData, 1);
            if (tmp == END_OF_STREAM)
                return(HANTRO_NOK);
            pPicTiming->clockTimeStampFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

            if (pPicTiming->clockTimeStampFlag[i])
            {
                tmp = h264bsdGetBits(pStrmData, 2);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                pPicTiming->ctType[i] = tmp;

                tmp = h264bsdGetBits(pStrmData, 1);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                pPicTiming->nuitFieldBasedFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

                tmp = h264bsdGetBits(pStrmData, 5);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                if (tmp > 6)
                    return(HANTRO_NOK);
                pPicTiming->countingType[i] = tmp;

                tmp = h264bsdGetBits(pStrmData, 1);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                pPicTiming->fullTimeStampFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

                tmp = h264bsdGetBits(pStrmData, 1);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                pPicTiming->discontinuityFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

                tmp = h264bsdGetBits(pStrmData, 1);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                pPicTiming->cntDroppedFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

                tmp = h264bsdGetBits(pStrmData, 8);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                pPicTiming->nFrames[i] = tmp;

                if (pPicTiming->fullTimeStampFlag[i])
                {
                    tmp = h264bsdGetBits(pStrmData, 6);
                    if (tmp == END_OF_STREAM)
                        return(HANTRO_NOK);
                    if (tmp > 59)
                        return(HANTRO_NOK);
                    pPicTiming->secondsValue[i] = tmp;

                    tmp = h264bsdGetBits(pStrmData, 6);
                    if (tmp == END_OF_STREAM)
                        return(HANTRO_NOK);
                    if (tmp > 59)
                        return(HANTRO_NOK);
                    pPicTiming->minutesValue[i] = tmp;

                    tmp = h264bsdGetBits(pStrmData, 5);
                    if (tmp == END_OF_STREAM)
                        return(HANTRO_NOK);
                    if (tmp > 23)
                        return(HANTRO_NOK);
                    pPicTiming->hoursValue[i] = tmp;
                }
                else
                {
                    tmp = h264bsdGetBits(pStrmData, 1);
                    if (tmp == END_OF_STREAM)
                        return(HANTRO_NOK);
                    pPicTiming->secondsFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

                    if (pPicTiming->secondsFlag[i])
                    {
                        tmp = h264bsdGetBits(pStrmData, 6);
                        if (tmp == END_OF_STREAM)
                            return(HANTRO_NOK);
                        if (tmp > 59)
                            return(HANTRO_NOK);
                        pPicTiming->secondsValue[i] = tmp;

                        tmp = h264bsdGetBits(pStrmData, 1);
                        if (tmp == END_OF_STREAM)
                            return(HANTRO_NOK);
                        pPicTiming->minutesFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

                        if (pPicTiming->minutesFlag[i])
                        {
                            tmp = h264bsdGetBits(pStrmData, 6);
                            if (tmp == END_OF_STREAM)
                                return(HANTRO_NOK);
                            if (tmp > 59)
                                return(HANTRO_NOK);
                            pPicTiming->minutesValue[i] = tmp;

                            tmp = h264bsdGetBits(pStrmData, 1);
                            if (tmp == END_OF_STREAM)
                                return(HANTRO_NOK);
                            pPicTiming->hoursFlag[i] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;

                            if (pPicTiming->hoursFlag[i])
                            {
                                tmp = h264bsdGetBits(pStrmData, 5);
                                if (tmp == END_OF_STREAM)
                                    return(HANTRO_NOK);
                                if (tmp > 23)
                                    return(HANTRO_NOK);
                                pPicTiming->hoursValue[i] = tmp;
                            }
                        }
                    }
                }
                if (timeOffsetLength)
                {
                    tmp = h264bsdGetBits(pStrmData, timeOffsetLength);
                    if (tmp == END_OF_STREAM)
                        return(HANTRO_NOK);
                    itmp = (i32)tmp;
                    /* following "converts" timeOffsetLength-bit signed
                     * integer into i32 */
                    /*lint -save -e701 -e702 */
                    itmp <<= (32 - timeOffsetLength);
                    itmp >>= (32 - timeOffsetLength);
                    /*lint -restore */
                    pPicTiming->timeOffset[i] = itmp;
                                    }
                else
                    pPicTiming->timeOffset[i] = 0;
            }
        }
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodePanScanRectangle

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodePanScanRectangle(
  strmData_t *pStrmData,
  seiPanScanRect_t *pPanScanRectangle)
{

/* Variables */

    u32 tmp, i;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pPanScanRectangle);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pPanScanRectangle->panScanRectId);
    if (tmp != HANTRO_OK)
        return(tmp);

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pPanScanRectangle->panScanRectCancelFlag = tmp == 1 ?
                                HANTRO_TRUE : HANTRO_FALSE;

    if (!pPanScanRectangle->panScanRectCancelFlag)
    {
        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
          &pPanScanRectangle->panScanCnt);
        if (tmp != HANTRO_OK)
            return(tmp);
        if (pPanScanRectangle->panScanCnt > 2)
            return(HANTRO_NOK);
        pPanScanRectangle->panScanCnt++;

        for (i = 0; i < pPanScanRectangle->panScanCnt; i++)
        {
            tmp = h264bsdDecodeExpGolombSigned(pStrmData,
              &pPanScanRectangle->panScanRectLeftOffset[i]);
            if (tmp != HANTRO_OK)
                return(tmp);

            tmp = h264bsdDecodeExpGolombSigned(pStrmData,
              &pPanScanRectangle->panScanRectRightOffset[i]);
            if (tmp != HANTRO_OK)
                return(tmp);

            tmp = h264bsdDecodeExpGolombSigned(pStrmData,
              &pPanScanRectangle->panScanRectTopOffset[i]);
            if (tmp != HANTRO_OK)
                return(tmp);

            tmp = h264bsdDecodeExpGolombSigned(pStrmData,
              &pPanScanRectangle->panScanRectBottomOffset[i]);
            if (tmp != HANTRO_OK)
                return(tmp);
        }
        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
          &pPanScanRectangle->panScanRectRepetitionPeriod);
        if (tmp != HANTRO_OK)
            return(tmp);
        if (pPanScanRectangle->panScanRectRepetitionPeriod > 16384)
            return(HANTRO_NOK);
        if (pPanScanRectangle->panScanCnt > 1 &&
          pPanScanRectangle->panScanRectRepetitionPeriod > 1)
            return(HANTRO_NOK);
    }

    return(HANTRO_OK);
}

/*------------------------------------------------------------------------------

    Function: DecodeFillerPayload

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeFillerPayload(strmData_t *pStrmData, u32 payloadSize)
{

/* Variables */

/* Code */

    ASSERT(pStrmData);

    if (payloadSize)
        if (h264bsdFlushBits(pStrmData, 8 * payloadSize) == END_OF_STREAM)
            return(HANTRO_NOK);

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeUserDataRegisteredITuTT35

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeUserDataRegisteredITuTT35(
  strmData_t *pStrmData,
  seiUserDataRegisteredItuTT35_t *pUserDataRegisteredItuTT35,
  u32 payloadSize)
{

/* Variables */

    u32 tmp, i, j;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pUserDataRegisteredItuTT35);
    ASSERT(payloadSize);

        tmp = h264bsdGetBits(pStrmData, 8);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pUserDataRegisteredItuTT35->ituTT35CountryCode = tmp;

    if (pUserDataRegisteredItuTT35->ituTT35CountryCode != 0xFF)
        i = 1;
    else
    {
        tmp = h264bsdGetBits(pStrmData, 8);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pUserDataRegisteredItuTT35->ituTT35CountryCodeExtensionByte = tmp;
        i = 2;
    }

    /* where corresponding FREE() ??? */
    ALLOCATE(pUserDataRegisteredItuTT35->ituTT35PayloadByte,payloadSize-i,u8);
    pUserDataRegisteredItuTT35->numPayloadBytes = payloadSize - i;
    if (pUserDataRegisteredItuTT35->ituTT35PayloadByte == NULL)
        return(MEMORY_ALLOCATION_ERROR);

    j = 0;
    do
    {
        tmp = h264bsdGetBits(pStrmData, 8);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pUserDataRegisteredItuTT35->ituTT35PayloadByte[j] = (u8)tmp;
        i++;
        j++;
    } while (i < payloadSize);

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeUserDataUnregistered

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeUserDataUnregistered(
  strmData_t *pStrmData,
  seiUserDataUnregistered_t *pUserDataUnregistered,
  u32 payloadSize)
{

/* Variables */

    u32 i, tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pUserDataUnregistered);

    for (i = 0; i < 4; i++)
    {
        pUserDataUnregistered->uuidIsoIec11578[i] = h264bsdShowBits32(pStrmData);
        if (h264bsdFlushBits(pStrmData,32) == END_OF_STREAM)
            return(HANTRO_NOK);
    }

    /* where corresponding FREE() ??? */
    ALLOCATE(pUserDataUnregistered->userDataPayloadByte, payloadSize - 16, u8);
    if (pUserDataUnregistered->userDataPayloadByte == NULL)
        return(MEMORY_ALLOCATION_ERROR);

    pUserDataUnregistered->numPayloadBytes = payloadSize - 16;

    for (i = 0; i < payloadSize - 16; i++)
    {
        tmp = h264bsdGetBits(pStrmData, 8);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pUserDataUnregistered->userDataPayloadByte[i] = (u8)tmp;
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeRecoveryPoint

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeRecoveryPoint(
  strmData_t *pStrmData,
  seiRecoveryPoint_t *pRecoveryPoint)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pRecoveryPoint);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
        &pRecoveryPoint->recoveryFrameCnt);
    if (tmp != HANTRO_OK)
        return(tmp);

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pRecoveryPoint->exactMatchFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pRecoveryPoint->brokenLinkFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    tmp = h264bsdGetBits(pStrmData, 2);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    if (tmp > 2)
        return(HANTRO_NOK);
    pRecoveryPoint->changingSliceGroupIdc = tmp;

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeDecRefPicMarkingRepetition

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeDecRefPicMarkingRepetition(
  strmData_t *pStrmData,
  seiDecRefPicMarkingRepetition_t *pDecRefPicMarkingRepetition,
  u32 numRefFrames)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pDecRefPicMarkingRepetition);

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pDecRefPicMarkingRepetition->originalIdrFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pDecRefPicMarkingRepetition->originalFrameNum);
    if (tmp != HANTRO_OK)
        return(tmp);

    /* frame_mbs_only_flag assumed always true so some field related syntax
     * elements are skipped, see H.264 standard */
    tmp = h264bsdDecRefPicMarking(pStrmData,
      &pDecRefPicMarkingRepetition->decRefPicMarking, NAL_SEI, numRefFrames);

    return(tmp);

}

/*------------------------------------------------------------------------------

    Function: DecodeSparePic

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeSparePic(
  strmData_t *pStrmData,
  seiSparePic_t *pSparePic,
  u32 picSizeInMapUnits)
{

/* Variables */

    u32 tmp, i, j, mapUnitCnt;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pSparePic);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
        &pSparePic->targetFrameNum);
    if (tmp != HANTRO_OK)
        return(tmp);

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSparePic->spareFieldFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;
    /* do not accept fields */
    if (pSparePic->spareFieldFlag)
        return(HANTRO_NOK);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData, &pSparePic->numSparePics);
    if (tmp != HANTRO_OK)
        return(tmp);
    pSparePic->numSparePics++;
    if (pSparePic->numSparePics > MAX_NUM_SPARE_PICS)
        return(HANTRO_NOK);

    for (i = 0; i < pSparePic->numSparePics; i++)
    {
        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
          &pSparePic->deltaSpareFrameNum[i]);
        if (tmp != HANTRO_OK)
            return(tmp);

        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
            &pSparePic->spareAreaIdc[i]);
        if (tmp != HANTRO_OK)
            return(tmp);
        if (pSparePic->spareAreaIdc[i] > 2)
            return(HANTRO_NOK);

        if (pSparePic->spareAreaIdc[i] == 1)
        {
            /* where corresponding FREE() ??? */
            ALLOCATE(pSparePic->spareUnitFlag[i], picSizeInMapUnits, u32);
            if (pSparePic->spareUnitFlag[i] == NULL)
                return(MEMORY_ALLOCATION_ERROR);
            pSparePic->zeroRunLength[i] = NULL;

            for (j = 0; j < picSizeInMapUnits; j++)
            {
                tmp = h264bsdGetBits(pStrmData, 1);
                if (tmp == END_OF_STREAM)
                    return(HANTRO_NOK);
                pSparePic->spareUnitFlag[i][j] = tmp == 1 ?
                                    HANTRO_TRUE : HANTRO_FALSE;
            }
        }
        else if (pSparePic->spareAreaIdc[i] == 2)
        {
            /* where corresponding FREE() ??? */
            ALLOCATE(pSparePic->zeroRunLength[i], picSizeInMapUnits, u32);
            if (pSparePic->zeroRunLength[i] == NULL)
                return(MEMORY_ALLOCATION_ERROR);
            pSparePic->spareUnitFlag[i] = NULL;

            for (j = 0, mapUnitCnt = 0; mapUnitCnt < picSizeInMapUnits; j++)
            {
                tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
                  &pSparePic->zeroRunLength[i][j]);
                if (tmp != HANTRO_OK)
                    return(tmp);
                mapUnitCnt += pSparePic->zeroRunLength[i][j] + 1;
            }
        }
    }

    /* set rest to null */
    for (i = pSparePic->numSparePics; i < MAX_NUM_SPARE_PICS; i++)
    {
        pSparePic->spareUnitFlag[i] = NULL;
        pSparePic->zeroRunLength[i] = NULL;
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeSceneInfo

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeSceneInfo(
  strmData_t *pStrmData,
  seiSceneInfo_t *pSceneInfo)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pSceneInfo);

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSceneInfo->sceneInfoPresentFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    if (pSceneInfo->sceneInfoPresentFlag)
    {
        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData, &pSceneInfo->sceneId);
        if (tmp != HANTRO_OK)
            return(tmp);

        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
          &pSceneInfo->sceneTransitionType);
        if (tmp != HANTRO_OK)
            return(tmp);
        if (pSceneInfo->sceneTransitionType > 6)
            return(HANTRO_NOK);

        if (pSceneInfo->sceneTransitionType)
        {
            tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
              &pSceneInfo->secondSceneId);
            if (tmp != HANTRO_OK)
                return(tmp);
        }

    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeSubSeqInfo

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

-----------------------------------------------------------------------------*/

static u32 DecodeSubSeqInfo(
  strmData_t *pStrmData,
  seiSubSeqInfo_t *pSubSeqInfo)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pSubSeqInfo);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
        &pSubSeqInfo->subSeqLayerNum);
    if (tmp != HANTRO_OK)
        return(tmp);
    if (pSubSeqInfo->subSeqLayerNum > 255)
        return(HANTRO_NOK);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData, &pSubSeqInfo->subSeqId);
    if (tmp != HANTRO_OK)
        return(tmp);
    if (pSubSeqInfo->subSeqId > 65535)
        return(HANTRO_NOK);

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSubSeqInfo->firstRefPicFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSubSeqInfo->leadingNonRefPicFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSubSeqInfo->lastPicFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSubSeqInfo->subSeqFrameNumFlag = tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    if (pSubSeqInfo->subSeqFrameNumFlag)
    {
        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
            &pSubSeqInfo->subSeqFrameNum);
        if (tmp != HANTRO_OK)
            return(tmp);
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeSubSeqLayerCharacteristics

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeSubSeqLayerCharacteristics(
  strmData_t *pStrmData,
  seiSubSeqLayerCharacteristics_t *pSubSeqLayerCharacteristics)
{

/* Variables */

    u32 tmp, i;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pSubSeqLayerCharacteristics);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pSubSeqLayerCharacteristics->numSubSeqLayers);
    if (tmp != HANTRO_OK)
        return(tmp);
    pSubSeqLayerCharacteristics->numSubSeqLayers++;
    if (pSubSeqLayerCharacteristics->numSubSeqLayers > MAX_NUM_SUB_SEQ_LAYERS)
        return(HANTRO_NOK);

    for (i = 0; i < pSubSeqLayerCharacteristics->numSubSeqLayers; i++)
    {
        tmp = h264bsdGetBits(pStrmData, 1);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pSubSeqLayerCharacteristics->accurateStatisticsFlag[i] =
            tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

        tmp = h264bsdGetBits(pStrmData, 16);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pSubSeqLayerCharacteristics->averageBitRate[i] = tmp;

        tmp = h264bsdGetBits(pStrmData, 16);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pSubSeqLayerCharacteristics->averageFrameRate[i] = tmp;
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeSubSeqCharacteristics

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeSubSeqCharacteristics(
  strmData_t *pStrmData,
  seiSubSeqCharacteristics_t *pSubSeqCharacteristics)
{

/* Variables */

    u32 tmp, i;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pSubSeqCharacteristics);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pSubSeqCharacteristics->subSeqLayerNum);
    if (tmp != HANTRO_OK)
        return(tmp);
    if (pSubSeqCharacteristics->subSeqLayerNum > MAX_NUM_SUB_SEQ_LAYERS-1)
        return(HANTRO_NOK);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
        &pSubSeqCharacteristics->subSeqId);
    if (tmp != HANTRO_OK)
        return(tmp);
    if (pSubSeqCharacteristics->subSeqId > 65535)
        return(HANTRO_NOK);

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSubSeqCharacteristics->durationFlag = tmp == 1 ?
                            HANTRO_TRUE : HANTRO_FALSE;

    if (pSubSeqCharacteristics->durationFlag)
    {
        pSubSeqCharacteristics->subSeqDuration = h264bsdShowBits32(pStrmData);
        if (h264bsdFlushBits(pStrmData,32) == END_OF_STREAM)
            return(HANTRO_NOK);
    }

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pSubSeqCharacteristics->averageRateFlag = tmp == 1 ?
                            HANTRO_TRUE : HANTRO_FALSE;

    if (pSubSeqCharacteristics->averageRateFlag)
    {
        tmp = h264bsdGetBits(pStrmData, 1);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pSubSeqCharacteristics->accurateStatisticsFlag =
            tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

        tmp = h264bsdGetBits(pStrmData, 16);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pSubSeqCharacteristics->averageBitRate = tmp;

        tmp = h264bsdGetBits(pStrmData, 16);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pSubSeqCharacteristics->averageFrameRate = tmp;
    }

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pSubSeqCharacteristics->numReferencedSubseqs);
    if (tmp != HANTRO_OK)
        return(tmp);
    if (pSubSeqCharacteristics->numReferencedSubseqs > MAX_NUM_SUB_SEQ_LAYERS-1)
        return(HANTRO_NOK);

    for (i = 0; i < pSubSeqCharacteristics->numReferencedSubseqs; i++)
    {
        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
          &pSubSeqCharacteristics->refSubSeqLayerNum[i]);
        if (tmp != HANTRO_OK)
            return(tmp);

        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
          &pSubSeqCharacteristics->refSubSeqId[i]);
        if (tmp != HANTRO_OK)
            return(tmp);

        tmp = h264bsdGetBits(pStrmData, 1);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pSubSeqCharacteristics->refSubSeqDirection[i] = tmp;
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeFullFrameFreeze

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeFullFrameFreeze(
  strmData_t *pStrmData,
  seiFullFrameFreeze_t *pFullFrameFreeze)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pFullFrameFreeze);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pFullFrameFreeze->fullFrameFreezeRepetitionPeriod);
    if (tmp != HANTRO_OK)
        return(tmp);
    if (pFullFrameFreeze->fullFrameFreezeRepetitionPeriod > 16384)
        return(HANTRO_NOK);

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeFullFrameSnapshot

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeFullFrameSnapshot(
  strmData_t *pStrmData,
  seiFullFrameSnapshot_t *pFullFrameSnapshot)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pFullFrameSnapshot);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
        &pFullFrameSnapshot->snapShotId);
    if (tmp != HANTRO_OK)
        return(tmp);

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeProgressiveRefinementSegmentStart

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeProgressiveRefinementSegmentStart(
  strmData_t *pStrmData,
  seiProgressiveRefinementSegmentStart_t *pProgressiveRefinementSegmentStart)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pProgressiveRefinementSegmentStart);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pProgressiveRefinementSegmentStart->progressiveRefinementId);
    if (tmp != HANTRO_OK)
        return(tmp);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pProgressiveRefinementSegmentStart->numRefinementSteps);
    if (tmp != HANTRO_OK)
        return(tmp);
    pProgressiveRefinementSegmentStart->numRefinementSteps++;

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeProgressiveRefinementSegmentEnd

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeProgressiveRefinementSegmentEnd(
  strmData_t *pStrmData,
  seiProgressiveRefinementSegmentEnd_t *pProgressiveRefinementSegmentEnd)
{

/* Variables */

    u32 tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pProgressiveRefinementSegmentEnd);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pProgressiveRefinementSegmentEnd->progressiveRefinementId);
    if (tmp != HANTRO_OK)
        return(tmp);

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeMotionConstrainedSliceGroupSet

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeMotionConstrainedSliceGroupSet(
  strmData_t *pStrmData,
  seiMotionConstrainedSliceGroupSet_t *pMotionConstrainedSliceGroupSet,
  u32 numSliceGroups)
{

/* Variables */

    u32 tmp,i;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pMotionConstrainedSliceGroupSet);
    ASSERT(numSliceGroups < MAX_NUM_SLICE_GROUPS);

    tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
      &pMotionConstrainedSliceGroupSet->numSliceGroupsInSet);
    if (tmp != HANTRO_OK)
        return(tmp);
    pMotionConstrainedSliceGroupSet->numSliceGroupsInSet++;
    if (pMotionConstrainedSliceGroupSet->numSliceGroupsInSet > numSliceGroups)
        return(HANTRO_NOK);

    for (i = 0; i < pMotionConstrainedSliceGroupSet->numSliceGroupsInSet; i++)
    {
        tmp = h264bsdGetBits(pStrmData,
            ceilLog2NumSliceGroups[numSliceGroups]);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pMotionConstrainedSliceGroupSet->sliceGroupId[i] = tmp;
        if (pMotionConstrainedSliceGroupSet->sliceGroupId[i] >
          pMotionConstrainedSliceGroupSet->numSliceGroupsInSet-1)
            return(HANTRO_NOK);
    }

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pMotionConstrainedSliceGroupSet->exactSampleValueMatchFlag =
        tmp == 1 ? HANTRO_TRUE : HANTRO_FALSE;

    tmp = h264bsdGetBits(pStrmData, 1);
    if (tmp == END_OF_STREAM)
        return(HANTRO_NOK);
    pMotionConstrainedSliceGroupSet->panScanRectFlag = tmp == 1 ?
                                        HANTRO_TRUE : HANTRO_FALSE;

    if (pMotionConstrainedSliceGroupSet->panScanRectFlag)
    {
        tmp = h264bsdDecodeExpGolombUnsigned(pStrmData,
          &pMotionConstrainedSliceGroupSet->panScanRectId);
        if (tmp != HANTRO_OK)
            return(tmp);
    }

    return(HANTRO_OK);

}

/*------------------------------------------------------------------------------

    Function: DecodeReservedSeiMessage

        Functional description:
          <++>
        Inputs:
          <++>
        Outputs:
          <++>

------------------------------------------------------------------------------*/

static u32 DecodeReservedSeiMessage(
  strmData_t *pStrmData,
  seiReservedSeiMessage_t *pReservedSeiMessage,
  u32 payloadSize)
{

/* Variables */

    u32 i, tmp;

/* Code */

    ASSERT(pStrmData);
    ASSERT(pReservedSeiMessage);

    /* where corresponding FREE() ??? */
    ALLOCATE(pReservedSeiMessage->reservedSeiMessagePayloadByte,payloadSize,u8);
    if (pReservedSeiMessage->reservedSeiMessagePayloadByte == NULL)
        return(MEMORY_ALLOCATION_ERROR);

    pReservedSeiMessage->numPayloadBytes = payloadSize;

    for (i = 0; i < payloadSize; i++)
    {
        tmp = h264bsdGetBits(pStrmData,8);
        if (tmp == END_OF_STREAM)
            return(HANTRO_NOK);
        pReservedSeiMessage->reservedSeiMessagePayloadByte[i] = (u8)tmp;
    }

    return(HANTRO_OK);

}


text:
{% load i18n %}
{% extends "html/services/page.html" %}

{% block title %}{% trans %}Service Support{% endtrans %}{% endblock %}

{% block class_owned %}sidebar-link-active{% endblock %}

{% block sidebar_right %}

{% trans %}Filter by{% endtrans %}
<form action="" method="get" class="content-filter-form">

        {{ filters.as_ul()|htsafe }}

    <input type="submit" value="{% trans %}Submit{% endtrans %}">
</form>

{% trans %}Download as:{% endtrans %}
{% if '?' in request.get_full_path() %}<a class="pdf-block-link" href="{{ request.get_full_path()|replace('.ajax','').replace('?','.pdf?') }}"{% else %}PDF
  CSV
{% endblock %}

{% block module_content %}

<form action="" method="post">
{% csrf_token %}

  {% if queues %}

      <input type="hidden" name="massform" value="massform" />
       {{ massform.as_ul()|htsafe }}

          <input type="submit" value="{% trans %}Save{% endtrans %}" />

    {% for queue in queues %}

        <input type="checkbox" name="mass-queue-{{ queue.id }}" value="{{ queue.id }}" class="group-control" />
        {{ queue }}

            {% trans %}Add{% endtrans %}

    {% set render_tickets = htsort(tickets.filter(queue=queue)) %}
    {% if render_tickets %}
    {{ services_ticket_list(render_tickets, queue) }}
    {% else %}

        {% trans %}No Active Tickets{% endtrans %}.
        {% if agent %}
        {% trans %}Create a Ticket{% endtrans %}
        {% endif %}

    {% endif %}

    {% endfor %}

    {% set render_tickets = htsort(tickets.filter(queue__isnull=True)) %}
    {% if render_tickets %}

        {% trans %}Unclassified Tickets{% endtrans %}

    {{ services_ticket_list(render_tickets, skip_group=True) }}
    {% endif %}
  {% else %}
  {{ show_hint('services') }}
  {% endif %}

</form>
{% endblock %}


text:
{% data src="../../hackathons/fcq/fcq.clean.json" %}
{% enddata %}

# Report

As a class, we brainstormed and came up with a long list of further questions we
can ask based on the FCQ data. Out of these questions, our team chose to tackle on
the following questions. Each member on our team is reponsible for one question.

# How many instructors have taught each subject? Kari

{% lodash %}

var groups = _.groupBy(data, 'Subject');
// collect all the instructor names for each class and count uniq
var ret1 = _.mapValues(groups, function(d){
 	var instrArr = _.pluck(d, 'Instructors');
 	//var j = 0;
 	var nameArr = _.map(instrArr, function(d){
 		var names = _.pluck(d, 'name');
 		//if (j==0){console.log(names); j++}
 		return names;
 	});
 	return _.size(_.uniq(_.flatten(nameArr)));
});

return ret1;

{% endlodash %}

Subject
	Num Instructors

{% for key, value in result %}

        {{key}}
        {{value}}

{% endfor %}

# Does the instruction tends to give out higher grades if they teach more classes? or the reverse? Ming

{% lodash %}

var graded = _.filter(data,function(d){
	return d.hasOwnProperty("AVG_GRD");
})

var smallData = _.map(graded, function(d){
	var avg_grd = d.AVG_GRD;
	var nameArr = _.pluck(d.Instructors, 'name');
 	var objArray = _.map(nameArr, function(d){
 		var obj = {name:d,AVG_GRD:avg_grd};
 		return obj;
 	})
 	return objArray;
});

var groups = _.groupBy(_.flatten(smallData),'name');
var groups2 = _.map(groups, function(d){
	var avg = _.reduce(d, function(total,e){
		return total+e.AVG_GRD;
	},0)/_.size(d);
	var obj = {classcount:_.size(d),AVG_GRD:avg,name:_.first(d).name}
	return obj;
});

var groups3 = _.groupBy(groups2,'classcount');
var avgbyCount = _.mapValues(groups3, function(d){
	var avg = _.round(_.reduce(d, function(total,e){
		return total+e.AVG_GRD;
	},0)/_.size(d),2);
	var obj = {classcount:_.first(d).classcount,AVG_GRD:avg,instrCount:_.size(d)}
	return obj;
});

return avgbyCount
{% endlodash %}
Based on the table below, there does not seem to be a trend between the number of classes taught and average grade.

Num Classes Taught
	Avg Grade	Num Instructors

{% for num, obj in result %}

        {{num}}
        {{obj.AVG_GRD}}
        {{obj.instrCount}}

{% endfor %}

# Which department has the lowest enrollment? John

{% lodash %}
var grps = _.groupBy(data, 'CrsPBADept')
var ret1 = _.mapValues(grps, function(d){
  var enrollNumbers = _.pluck(d, 'N.ENROLL')
  return _.sum(enrollNumbers)
  })
  var min = _.min(ret1)
  var dept = _.pick(ret1, function(d){
    return d == min
    })

return dept

{% endlodash %}

{% for key, value in result %}

        {{key}}
        {{value}}

{% endfor %}

# Which subject is most in demand,based on the total number of enrollment? Sussant

{% lodash %}
var group = _.groupBy(data, "Subject")
var sum = _.mapValues(group, function(n){
    var enroll = _.pluck(n, "N.ENROLL")
    return _.sum(enroll)
})
var max = _.max(sum)
var result = _.pick(sum, function(x){
    return x == max
})
return result
{% endlodash %}

{{result | json}}

{% for key, val in result %}
{{key}} is the subject most in demand with {{val}} enrollments.
{% endfor %}

# Which course has the highest enrollment? Andrew

{% lodash %}
var grps = _.groupBy(data, 'CourseTitle')
var ret1 = _.mapValues(grps, function(d){
  var enrollNumbers = _.pluck(d, 'N.ENROLL')
  return _.sum(enrollNumbers)
  })
  var max = _.max(ret1)
  var bigClass = _.pick(ret1, function(d){
    return d == max
    })

return bigClass

{% endlodash %}

{% for key, value in result %}

        {{key}}
        {{value}}

{% endfor %}


text:
---
uid: SolidEdgePart.Subtract
summary:
remarks:
example: [*content]
---
[!code-vb[Main](..\snippets\SolidEdgePart.Subtract.vb]
[!code-csharp[Main](..\snippets\SolidEdgePart.Subtract.cs]


text:
/**
 *
 */
package com.github.gwtd3.api.interpolators;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * Represents an object that can create an {@link Interpolator}.
 *

 * A factory should return null when no interpolators support the input arguments.
 *
 * @author Anthony Schiochet
 *
 */
public interface InterpolatorFactory<O> {

	/**
	 * Create an interpolator appropriate for interpolating the input value, or return null if the factory does not support the two
	 * specified input values.
	 *

	 *
	 * @param a
	 *            the start input param
	 * @param b
	 *            the end input param
	 *
	 * @return an appropriate interpolator or null if the factory does not support the input values.
	 */
	 Interpolator<O> create(I a, I b);

	/**
	 * Return a one-arg JS function wrapping the interpolation.
	 *

	 * Consider using {@link CallableInterpolator} for your own interpolation.
	 *

	 *
	 * @return the JS function
	 */
	public JavaScriptObject asJSOFunction();
}


text:
@(title: String, courts: List[Court])
@import utils.Tags._

@scripts = {
    <link rel="stylesheet" href="@routes.Assets.at("stylesheets/courts.css")" />

}

@Main(title, scripts) {

                    <form id="search-button">

                        <input id="search" type="text" placeholder="Enter part of a court name" class="form-control"/>

                            <button  class="btn btn-default" type="submit">Search</button>

                    </form>

                        @for(court <- courts) {

                                @court.getName

                        }

}


text:
package org.elasticsearch.index.mapper;

import com.google.common.base.Function;
import com.google.common.collect.Iterators;
import com.google.common.collect.Sets;
import org.elasticsearch.common.collect.CopyOnWriteHashMap;
import org.elasticsearch.common.regex.Regex;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

/**
 * An immutable container for looking up {@link MappedFieldType}s by their name.
 */
class FieldTypeLookup implements Iterable<MappedFieldType> {
    private static final Function<MappedFieldTypeReference, MappedFieldType> UNWRAPPER = new Function<MappedFieldTypeReference, MappedFieldType>() {
        @Override
        public MappedFieldType apply(MappedFieldTypeReference ref) {
            return ref.get();
        }
    };

    /** Full field name to field type */
    private final CopyOnWriteHashMap<String, MappedFieldTypeReference> fullNameToFieldType;

    /** Index field name to field type */
    private final CopyOnWriteHashMap<String, MappedFieldTypeReference> indexNameToFieldType;

    /** Create a new empty instance. */
    public FieldTypeLookup() {
        fullNameToFieldType = new CopyOnWriteHashMap<>();
        indexNameToFieldType = new CopyOnWriteHashMap<>();
    }

    private FieldTypeLookup(CopyOnWriteHashMap<String, MappedFieldTypeReference> fullName, CopyOnWriteHashMap<String, MappedFieldTypeReference> indexName) {
        fullNameToFieldType = fullName;
        indexNameToFieldType = indexName;
    }

    /**
     * Return a new instance that contains the union of this instance and the field types
     * from the provided fields. If a field already exists, the field type will be updated
     * to use the new mappers field type.
     */
    public FieldTypeLookup copyAndAddAll(Collection<FieldMapper> newFieldMappers) {
        CopyOnWriteHashMap<String, MappedFieldTypeReference> fullName = this.fullNameToFieldType;
        CopyOnWriteHashMap<String, MappedFieldTypeReference> indexName = this.indexNameToFieldType;

        for (FieldMapper fieldMapper : newFieldMappers) {
            MappedFieldType fieldType = fieldMapper.fieldType();
            MappedFieldTypeReference fullNameRef = fullName.get(fieldType.names().fullName());
            MappedFieldTypeReference indexNameRef = indexName.get(fieldType.names().indexName());
            if (fullNameRef == null && indexNameRef == null) {
                // new field, just use the ref from this field mapper
                fullName = fullName.copyAndPut(fieldType.names().fullName(), fieldMapper.fieldTypeReference());
                indexName = indexName.copyAndPut(fieldType.names().indexName(), fieldMapper.fieldTypeReference());
            } else if (fullNameRef == null) {
                // this index name already exists, so copy over the reference
                fullName = fullName.copyAndPut(fieldType.names().fullName(), indexNameRef);
                indexNameRef.set(fieldMapper.fieldType()); // field type is updated, since modifiable settings may have changed
                fieldMapper.setFieldTypeReference(indexNameRef);
            } else if (indexNameRef == null) {
                // this full name already exists, so copy over the reference
                indexName = indexName.copyAndPut(fieldType.names().indexName(), fullNameRef);
                fullNameRef.set(fieldMapper.fieldType()); // field type is updated, since modifiable settings may have changed
                fieldMapper.setFieldTypeReference(fullNameRef);
            } else if (fullNameRef == indexNameRef) {
                // the field already exists, so replace the reference in this mapper with the pre-existing one
                fullNameRef.set(fieldMapper.fieldType()); // field type is updated, since modifiable settings may have changed
                fieldMapper.setFieldTypeReference(fullNameRef);
            } else {
                // this new field bridges between two existing field names (a full and index name), which we cannot support
                throw new IllegalStateException("insane mappings found. field " + fieldType.names().fullName() + " maps across types to field " + fieldType.names().indexName());
            }
        }
        return new FieldTypeLookup(fullName, indexName);
    }

    /**
     * Checks if the given mappers' field types are compatible with existing field types.
     * If any are not compatible, an IllegalArgumentException is thrown.
     * If updateAllTypes is true, only basic compatibility is checked.
     */
    public void checkCompatibility(Collection<FieldMapper> newFieldMappers, boolean updateAllTypes) {
        for (FieldMapper fieldMapper : newFieldMappers) {
            MappedFieldTypeReference ref = fullNameToFieldType.get(fieldMapper.fieldType().names().fullName());
            if (ref != null) {
                List<String> conflicts = new ArrayList<>();
                ref.get().checkTypeName(fieldMapper.fieldType(), conflicts);
                if (conflicts.isEmpty()) { // only check compat if they are the same type
                    boolean strict = ref.getNumAssociatedMappers() > 1 && updateAllTypes == false;
                    ref.get().checkCompatibility(fieldMapper.fieldType(), conflicts, strict);
                }
                if (conflicts.isEmpty() == false) {
                    throw new IllegalArgumentException("Mapper for [" + fieldMapper.fieldType().names().fullName() + "] conflicts with existing mapping in other types" + conflicts.toString());
                }
            }

            // field type for the index name must be compatible too
            MappedFieldTypeReference indexNameRef = fullNameToFieldType.get(fieldMapper.fieldType().names().indexName());
            if (indexNameRef != null) {
                List<String> conflicts = new ArrayList<>();
                ref.get().checkTypeName(fieldMapper.fieldType(), conflicts);
                if (conflicts.isEmpty()) { // only check compat if they are the same type
                    boolean strict = indexNameRef.getNumAssociatedMappers() > 1 && updateAllTypes == false;
                    indexNameRef.get().checkCompatibility(fieldMapper.fieldType(), conflicts, strict);
                }
                if (conflicts.isEmpty() == false) {
                    throw new IllegalArgumentException("Mapper for [" + fieldMapper.fieldType().names().fullName() + "] conflicts with mapping with the same index name in other types" + conflicts.toString());
                }
            }
        }
    }

    /** Returns the field for the given field */
    public MappedFieldType get(String field) {
        MappedFieldTypeReference ref = fullNameToFieldType.get(field);
        if (ref == null) return null;
        return ref.get();
    }

    /** Returns the field type for the given index name */
    public MappedFieldType getByIndexName(String field) {
        MappedFieldTypeReference ref = indexNameToFieldType.get(field);
        if (ref == null) return null;
        return ref.get();
    }

    /**
     * Returns a list of the index names of a simple match regex like pattern against full name and index name.
     */
    public Collection<String> simpleMatchToIndexNames(String pattern) {
        Set<String> fields = Sets.newHashSet();
        for (MappedFieldType fieldType : this) {
            if (Regex.simpleMatch(pattern, fieldType.names().fullName())) {
                fields.add(fieldType.names().indexName());
            } else if (Regex.simpleMatch(pattern, fieldType.names().indexName())) {
                fields.add(fieldType.names().indexName());
            }
        }
        return fields;
    }

    /**
     * Returns a list of the full names of a simple match regex like pattern against full name and index name.
     */
    public Collection<String> simpleMatchToFullName(String pattern) {
        Set<String> fields = Sets.newHashSet();
        for (MappedFieldType fieldType : this) {
            if (Regex.simpleMatch(pattern, fieldType.names().fullName())) {
                fields.add(fieldType.names().fullName());
            } else if (Regex.simpleMatch(pattern, fieldType.names().indexName())) {
                fields.add(fieldType.names().fullName());
            }
        }
        return fields;
    }

    public Iterator<MappedFieldType> iterator() {
        return Iterators.transform(fullNameToFieldType.values().iterator(), UNWRAPPER);
    }
}


text:
package net.glowstone.entity.physics;

import org.bukkit.util.Vector;

/**
 * A BoundingBox which changes position over time as an entity moves.
 */
public class EntityBoundingBox extends BoundingBox {

    private final double width;
    private final double vertSize;
    private final double depth;

    public EntityBoundingBox(double horizSize, double vertSize) {
        this(horizSize, vertSize, horizSize);
    }

    /**
     * Creates an instance with the given size.
     *
     * @param width    the size on the X axis
     * @param vertSize the size on the Y axis
     * @param depth    the size on the Z axis
     */
    public EntityBoundingBox(double width, double vertSize, double depth) {
        this.width = width;
        this.vertSize = vertSize;
        this.depth = depth;
    }

    @Override
    public Vector getSize() {
        return new Vector(width, vertSize, depth);
    }

    /**
     * Moves this box so that its center is the given point.
     *
     * @param x the center X coordinate
     * @param y the center Y coordinate
     * @param z the center Z coordinate
     */
    public void setCenter(double x, double y, double z) {
        minCorner.setX(x - width / 2);
        minCorner.setY(y);
        minCorner.setZ(z - depth / 2);
        maxCorner.setX(x + width / 2);
        maxCorner.setY(y + vertSize);
        maxCorner.setZ(z + depth / 2);
    }

}


text:
package apple.avfoundation;

import java.io.*;
import java.nio.*;
import java.util.*;
import com.google.j2objc.annotations.*;
import com.google.j2objc.runtime.*;
import com.google.j2objc.runtime.block.*;
import apple.audiotoolbox.*;
import apple.corefoundation.*;
import apple.coregraphics.*;
import apple.coreservices.*;
import apple.foundation.*;
import apple.dispatch.*;
import apple.coreanimation.*;
import apple.coreaudio.*;
import apple.coremedia.*;
import apple.corevideo.*;
import apple.mediatoolbox.*;

/**
 * @since Available in iOS 5.0 and later.
 */
@Library("AVFoundation/AVFoundation.h") @Mapping("AVMediaSelectionOption")
public class AVMediaSelectionOption
    extends NSObject
    implements NSCopying {

    @Mapping("init")
    public AVMediaSelectionOption() { }

    @Mapping("mediaType")
    public native AVMediaType getMediaType();
    @Mapping("mediaSubTypes")
    public native NSArray<NSNumber> getMediaSubTypes();
    @Mapping("isPlayable")
    public native boolean isPlayable();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Mapping("extendedLanguageTag")
    public native String getExtendedLanguageTag();
    @Mapping("locale")
    public native NSLocale getLocale();
    @Mapping("commonMetadata")
    public native NSArray<AVMetadataItem> getCommonMetadata();
    @Mapping("availableMetadataFormats")
    public native List<AVMetadataFormat> getAvailableMetadataFormats();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Mapping("displayName")
    public native String getDisplayName();

    @Mapping("hasMediaCharacteristic:")
    public native boolean hasMediaCharacteristic(String mediaCharacteristic);
    @Mapping("metadataForFormat:")
    public native NSArray<AVMetadataItem> getMetadata(String format);
    @Mapping("associatedMediaSelectionOptionInMediaSelectionGroup:")
    public native AVMediaSelectionOption getAssociatedMediaSelectionOption(AVMediaSelectionGroup mediaSelectionGroup);
    @Mapping("propertyList")
    public native NSPropertyList getPropertyList();
    /**
     * @since Available in iOS 7.0 and later.
     */
    @Mapping("displayNameWithLocale:")
    public native String getDisplayName(NSLocale locale);
    @Mapping("copyWithZone:")
    public native Object copyWithZone$(NSZone zone);

}