android_kernel_google_msm/include/linux/videodev2.h
David Brown cf5a4992bf msm: vidc: Add msm video core driver
commit 72d9968a380b41386631d83bbca4f02fe87658c8
Author: Arun Menon <menon@codeaurora.org>
Date:   Wed Dec 26 22:09:02 2012 -0800

    msm: vidc: rename functions in hfi layer to hardware specific

    The V4L2 video driver hfi layer would be supporting
    Venus hardware and Q6 firmware for video encode\decode.
    So renaming the functions specific to Venus and common
    functionality accordingly.

    Change-Id: Iaacf44bfe4fd5735fe5e82f335e01e8a314f6575
    Signed-off-by: Arun Menon <menon@codeaurora.org>

commit 2f39048f9e548d11134ae686549f92283e23d319
Author: Arun Menon <menon@codeaurora.org>
Date:   Wed Dec 26 15:43:01 2012 -0800

    msm: vidc: move vidc resources inside hfi layer

    As a part of V4L2 video driver restructure, hardware
    specific resources such as ocmem, bus bw requests are
    moved inside hardware specific hfi layer. This is needed
    since same V4L2 video driver will be supporting video
    decode\encode on both venus and Q6 hardware.

    Change-Id: I35eef5051d07ba36f61eded3c58018fde28ca57d
    Signed-off-by: Arun Menon <menon@codeaurora.org>

commit bf94306622a59f35d4e0079e5df4ee60cedafe0c
Author: Arun Menon <menon@codeaurora.org>
Date:   Tue Dec 18 14:13:15 2012 -0800

    msm: vidc: create common packetization module

    Venus and Q6 host firmware interface (hfi) share common
    packet interface. The hfi_packetization module
    will be used by both Q6 and Venus hfi layers to create
    packets.

    Change-Id: I74d89d8568315a8e21fa07179eeeb1d9132048e9
    Signed-off-by: Arun Menon <menon@codeaurora.org>

commit d9223b518a19e40e306523b42678e3d1518673be
Author: Arun Menon <menon@codeaurora.org>
Date:   Mon Nov 5 13:56:04 2012 -0800

    msm: vidc: Rename hal files to hfi

    The v4l2 video driver will be supporting multiple
    Host Firmware Interface (HFI) layers, so renaming
    generic file names to hfi specific ones.

    Change-Id: If96e23619fc28a03841e9e41470d1de86406ad2f
    Signed-off-by: Arun Menon <menon@codeaurora.org>

commit ed7d1fa26f4ec8f263c63a926e6a5308ab4066bf
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Dec 14 16:22:08 2012 -0800

    msm_vidc: Add support to log Firmware debug messages

    Driver need to configure the debug mode to
    Venus firmware. Venus firmware won't send any
    messages to driver without this setting.
    This change fixes the same.

    Change-Id: I24cac6054afc65b9672bb5b294d641053ddd87ea
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit c66cd9a1ae4933b1585d381bfd44f36b9632deb6
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Dec 14 14:53:54 2012 -0800

    msm_vidc: Notify subsystem framework of venus subsystem crashes

    The subsystem framework will use this information to do
    housekeeping work on the subsystem like taking ramdumps
    (if enabled) when the next subsystem_put() is called, etc.

    Change-Id: I5b76acde223e46c04b51a6b84950f4d59566c8c7
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 484fa46427fddc8f72758b90b7646317cf688e32
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Dec 14 15:17:00 2012 -0800

    msm_vidc: Handle venus watchdog timeout

    Handle venus watchdog timeout by informing all
    clients about the error so that existing video
    sessions can be closed.

    Change-Id: I631e319c810d8114050b21038e2f9edbbaf7427e
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit ca878a968d466b432cfec23935bbeb10c9855d33
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Dec 14 13:57:54 2012 -0800

    msm_vidc: Remove SSR related code

    Remove venus subsystem restart related code as this
    code is obsolete now after architecture changes in
    subsystem restart framework.

    Change-Id: I429f5d6ccf6d0a6f0d2513fb0e52c2ed0206e77d
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 86aa0d6de817dbd4e9bd8a009621f297a7349aaf
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Dec 14 00:29:33 2012 -0800

    msm_vidc: Add support to send EOS NAL

    If FW detectd End Of Sequence through NAL unit, it
    sets a flag in FBD message. Add support to process
    this flag and convey to userspace.

    Change-Id: I1224199b0a0db727278898e6d8ef2bb49f814d57
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 1d498a8d96fd01691a1c05809feeb50cc881ec7e
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Oct 18 17:08:17 2012 -0700

    msm_vidc: Update bus bandwidth request to support 4kx2k resolution

    when running 4kx2k videos, video driver was not requesting enough bus
    bandwidth, resulting in low performance. This change updates bus
    request for both encoder and decoder.

    Change-Id: Ic5458338443d777ce3b9a274677c10a62581e9a2
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 9c52fe1998e67983e548a384b2ce6cf620a53fe2
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Dec 12 15:40:56 2012 -0800

    msm_vidc: Add error check for clock scaling.

    Clock scaling uses timestamp to determine the current fps.
    Timestamp for some frames might be invalid and shouldn't
    be used to calculate the fps. Add a check to handle this case.

    Change-Id: I8c570b131d11b1d2644806714fe2a726ca155eb5
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit aed3021f83932b0bc50ff52e6bc0b088a58c4223
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Tue Dec 11 18:27:23 2012 -0800

    msm: vidc: Numerator of timeperframe should be in seconds

    Currently we're treating the numerator of timeperframe as microseconds.
    This is contrary to the V4L2 spec, hence treat it in units of seconds.

    Change-Id: Id934e38c055fe8977557cd6ed464051330607439
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit d08430e2ffad551f7b99e591aab83c05060d278d
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Tue Oct 23 15:23:38 2012 -0700

    msm: vidc: Deprecate V4L2_CID_QCOM_VIDEO_SYNC_FRAME_SEQ_HDR

    Removing the vendor specific control V4L2_CID_QCOM_VIDEO_SYNC_FRAME_SEQ_HDR
    in favour of the more standard V4L2_CID_MPEG_VIDEO_HEADER_MODE.

    Change-Id: Iae2b357f23bbcd68af5b38fcbb08d97763dd1dc4
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 05c648e741255b2f7138f801496412a2ef3ccccc
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Wed Dec 5 18:03:25 2012 -0800

    msm: vidc: add support for V4L2_CID_MPEG_VIDEO_HEADER_MODE

    Add support for V4L2_CID_MPEG_VIDEO_HEADER_MODE, which changes the
    interface by which userspace can request for the video header.

    Change-Id: I412316c5173d677b2797b6b30f91dc0ead596718
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 5b624bbfabfafa36c443d9b36d5912979eeb753f
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Mon Oct 22 19:09:10 2012 -0700

    msm: vidc: Allow client to set only bitrate mode

    Add support for V4L2_CID_MPEG_VIDEO_BITRATE_MODE which is a standard
    V4L2 control.  This precedes the custom QCOM specific control which only
    allows the client to set the bitrate and the framerate.

    Change-Id: Idb2bef8f5b10a2d72c0d02be628f67eb878826c7
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 5084a757570b3ee5220442721d0bbff5787fe31f
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Mon Oct 22 16:21:28 2012 -0700

    msm: vidc: Add support for setting I-frame period

    Add support for the V4L2 standard control for setting I-frame period.
    Thus far, we've only had support for setting the IDR-frame period.

    Change-Id: I877ec596d9056dd24384718bcb397bc5b8e6eede
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 2c2836fb7572d2d5eeaf622fddb4f44734d2d860
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Mon Nov 5 18:39:43 2012 -0800

    msm: vidc: Group controls into clusters

    Organize related controls into clusters.  This commit does away with
    hacks to store values of related controls in static structures which
    inhibit concurrency use cases.

    CRs-Fixed: 414261
    Change-Id: I7347a8c10b57be22be34d88b0a1a7bca5ce8b8a1
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit d7cd510da3eff4645227144c2d33fcda074443f3
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Tue Oct 30 19:20:54 2012 -0700

    msm: vidc: Add support for decoder dynamic clock scaling

    Add support for dynamic clock scaling by calculating the
    decoding fps. Fps is calculated using input timestamps.

    CRs-fixed: 405399
    Change-Id: I0f09d902a3d44a9b93540ed652f872baf8ef8264
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 37529ad4569b2ab42d5b5690b6b286da58491b3b
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Dec 7 15:20:23 2012 -0800

    msm: vidc: Fallback to IOMMU heap

    Video buffer allocation falls back to IOMMU
    heap if MM heap runs out of memory. This helps
    reduce MM carveout size while supporting higher
    resolution encoding/decoding.

    CRs-fixed: 420585
    Change-Id: I3b71a722cbff3bcac32fdd3d74908685870d51ad
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit d9db1c618b1804eab402129878d710cd70a0f5c8
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Dec 6 16:44:33 2012 -0800

    msm: vidc: Print buffer address in hex

    Print buffer address in hex for readability.

    Change-Id: I8c747701b5a6f8c1669ad31537721954af135594
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit eea3cc694bfd3af1ba2643585a06736397543157
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Dec 5 17:38:36 2012 -0800

    msm: vidc: Driver cleanup on receiving SYS error

    SYS errors reported by firmware are handled properly
    and reported to client. On receiving SYS error client
    tries to close the driver. Cleanup in such scenarios
    was not proper. This change fixes that.

    CRs-fixed: 420316
    Change-Id: Ied7303bc2ecf4def6241dc7a37eceb1265417c2e
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit d8e3de6042849eab31df3d6ee4486dcb356eda3f
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Nov 16 17:31:30 2012 -0800

    msm: vidc: Add error check before calling release buffers to FW

    Release buffers can be called in any FW state. If release
    buffers called in non-release reources state, the FW might
    use them whereas the driver will unmap them causing IOMMU page fault.

    Change-Id: I21e7ac3e696594c0a802bd6066ef7a9a3ab9f12b
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit cc8192a0ace8ddd5bd44adca3347ff98296309a1
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Nov 28 17:08:27 2012 -0800

    msm: vidc: Fix NULL pointer exception

    The error check to validate the device open failure has an
    issue where it is checking the wrong variable. This lead
    to NULL pointer access. This change fixes the same.

    CRs-Fixed: 417092
    Change-Id: I635fc43b19a368c2477ab41c9d6d28ec9dc8524e
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 949c2524f9c8d3cf9dd9cf558c0a2cfd2dd2789f
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Nov 8 18:33:18 2012 -0800

    msm_vidc: Fix race condition during buffer release

    Firmware accessed buffers when driver was freeing them. To avoid this
    race condition, firmware now acknowledges release buffer command. Driver
    will wait for this response before releasing the buffers.

    CRs-fixed: 417952
    Change-Id: I1d28103fb4aa8ef55b3d3665a7202284887ae6f6
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 25731c7b1b5a36284729821c0f906392f000a4d6
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Nov 28 12:36:01 2012 -0800

    msm: vidc: Vote for DDR BW before FW download

    Vote for DDR bandwidth before downloading video
    firmware so that as soon as hardware is brought
    out of reset it is able to access firmware. Not
    doing this might result in IOMMU page faults
    on starting video playback or recording.

    Change-Id: I91ecdcdc4c57765f848f75ae6f476cee46a16829
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 7765f8331fe55363c35f3a28592bea064db6fbb1
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Nov 28 12:58:26 2012 -0800

    msm: vidc: Align secure buffer mappings to 1MB

    Secure buffer mappings should be aligned to 1MB
    for the mappings to succeed. This change takes
    care of that.

    Change-Id: I963df71271b9b24191ac94203d36a25fec90cdbf
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 4e4922b4c17353c60b5b89fb4ed32d81b9868dd1
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Tue Nov 27 12:17:11 2012 -0800

    msm: vidc: update driver for firmware interface changes

    This change updates the driver with the new FW interface
    changes. FW modified various packet structures. So the
    changes have made to update the driver accordingly.
    The changes are backward compatible so these work
    with old FW as well.

    Change-Id: I6b34eb1282c74b2ac4a5dd7fc4b4435b9517070b
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit bdcbe380dd07e711a20dbbc6da79768a8f2a6cbf
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Nov 26 21:01:52 2012 -0800

    msm: vidc: Unvote for bus BW after unloading FW

    Driver should unvote for bus bandwidth after all
    transactions are completed. Unvoting after unloading
    firmware makes sure there are no outstanding transactions.
    Without this change, stability of video playback might
    be impacted when video is played back to back.

    CRs-fixed: 419402
    Change-Id: I821f941183fc24ba65d6f17b3f39354e0d77b4bf
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 60802d92c6c96dd57c9b2d988dc3334e731c83fe
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Wed Nov 21 14:53:35 2012 -0800

    msm: vidc: Use proper msm_vidc_core when handling SYS_ERROR

    When handling SYS_ERROR use device_id to determine the core rather than
    find the core via the instance (contained with in session_id).  The
    firmware does not respond with the proper session_id in cases of
    SYS_ERROR.

    When handling SESSION_ERROR pass through the session_id returned by the
    firmware, so that the instance can be cleaned up properly.

    Change-Id: Ic38feb0878579403a1c8e108f18d46bea2891795
    CRs-Fixed: 419792
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit af26b337d6d092106c2fa099b2ed1a8cd3cf43af
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Nov 12 11:50:49 2012 -0800

    msm: vidc: Add control to enable extradata

    Add control to enable extradata. Client can use this
    control to enable a particular extradata for gathering
    additional information about the associated buffer.

    Change-Id: Ib39c614997cd43bee68fccac00d623ddd8caaf9b
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 110e12cc3807af1401986147e6b8371c0c38518e
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Mon Nov 5 12:24:57 2012 -0800

    msm: vidc: Add change in error check for FW buffer requirements

    FW buffer requirements for some buffers can be zero.
    Driver treat them as an error and returing bad buffer
    requirement which are actually valid.Add a fix to
    process the FW buffer requirement correctly.

    Change-Id: I7116fe5a03be77d10b1ecab737f0f3504377f80f
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit b0c1a9ae734a67a45e519bd67c5a1e7d9cbbea46
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Nov 9 15:44:03 2012 -0800

    msm: vidc: Add fix to update capture port buffer size

    If the resolution changed and no port reconfig, the
    V4L2 framework and driver have different capture port
    buffer sizes. Due to this mismatch the buffer is rejected
    by V4L2 framework.Add fix to update the buffer size.

    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
    Change-Id: Ib2ed5684aa10d13a614a3e213afb449d1c3dee8c

commit 6c03c29dbb9e70d172674c33391daff210710db9
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Tue Nov 13 13:35:25 2012 -0800

    msm: vidc: Fix a bug in state transition

    Fix a bug in state transition in driver. Without this
    fix some of the buffers were not released on firmware
    in following scenario:

    1. Video device is openend.
    2. Buffers are allocated.
    3. Video device is closed.

    This change fixes this issue.
    CRs-fixed: 419927

    Change-Id: I5f27b047971bcf1fb85e45a8c9d9938e177a4de5
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 6472cd488fe6f5d59b442745700f0f88f4318a35
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Sep 6 14:12:34 2012 -0700

    msm: vidc: Changes for secure video playback

    Changes required to protect and unprotect buffer
    memory for secure video playback.

    Change-Id: Ia918e35142852b9cb51275972692914d4b78bfb9
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit d4497883dad4e34d0755cb7585db1088c2fb969e
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Mon Nov 12 17:57:31 2012 -0800

    msm_vidc: venc: update input buffer count for firmware

    Setting max buffer count to firmware and later querying the buffer
    requirements after setting resolution and other properties will result
    in firmware returning max buffer count. To avoid allocating extra
    buffers, this change sets firmware with the max buffer count
    requested by client and firmware.

    Change-Id: I3d5e800ea3cdea4064d4e9d8453eb4d925c77f8c
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 0eaa2266918bb65a89d2a7df0ebb20aebf76c590
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Fri Nov 2 11:57:55 2012 -0700

    msm_vidc: update driver for firmware interface changes

    This change updates the driver to the new firmware requirements.
    Since, FW interface has changed significantly so pre-existing driver code
    does not work with this firmware. This change is a must for driver to
    work with new firmware. After this change, old FW will not work with this
    driver.

    Change-Id: I2f8408dd46909f7f527252410655c6fa919c465a
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 3823bbcf8132561b8da5a76d33d5bd2d143b3d82
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Oct 25 15:36:22 2012 -0700

    msm_vidc: Update firmware of input buffer count for video encoder

    If video firmware is not aware of input buffer count, and driver
    queues more buffers than firmware is aware of, this results in
    firmware crash. This change updates firmware of updated input buffer
    count.

    CRs-fixed: 411057
    Change-Id: I5713a300636071db80f532029cf81c3b88db0789
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 9e2d8826d1b6c7c7a7ccfd8da908af68a5a808aa
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Nov 7 16:23:05 2012 -0800

    msm: vidc: Fix a bug in free_irq

    Free irq should not be called with NULL but instead
    it should be called with hal_device.

    Change-Id: Ic45fbec37ab1c3d3ec877a0f89c7e1c7a1834f59
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit c4e0e5de4869c0bc3c91fddb0657c93bc997b324
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Tue Nov 6 15:50:10 2012 -0800

    msm: vidc: Remove SSR init/uninit calls

    SSR architecture has changed so driver does
    not need to call ssr init/uninit anymore.
    Changes need to be made according to new
    architecture. Removing the old code.

    Change-Id: I5a4334a4da604a78775864a310f2a12378a8de83
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 57860a865d0f91e0c40645c7d8dc0e2b9143936e
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Thu Nov 1 11:52:28 2012 -0700

    msm: vidc: Add support to process FW errors

    Adds support to process system and session
    errors received by FW and communicate them to
    client.

    Change-Id: Iddcb8f0b8a459cf7185e56121ffcbd6a3532e365
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 36f8d36a1fd675741df5e76e030c6bfc09bc6d17
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Oct 18 17:01:06 2012 -0700

    msm_vidc: update vbif setting for video hardware

    Update vbif registers to improve encode and decoder performance
    on 8974.

    Change-Id: I297968273c6acd8d753c310a34f24fa978a6e5f2
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit ff9c23f98a888f7acfe4416f9fd166e876e8d490
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Oct 26 13:09:10 2012 -0700

    msm: vidc: Fix iommu detach and pil_put order

    IOMMU detach should be called before subsystem_put.
    This change takes care of it.

    Change-Id: Iece3f548a152a443705223725763cb8ef6e37b80
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 72f479db62c0cec8080183d2171bd1967ba2598b
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Oct 31 15:30:25 2012 -0700

    msm: vidc: Remove SSR trigger for SYS error

    Firmware is incorrectly sending the SYS error
    for nonfatal error cases. This is causing
    the SSR trigger for invalid scenarios hence
    removing this trigger until it is fixed in
    firmware.

    Change-Id: If98a1b07d071a8c903fe2c6addf01747745c0ae5
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 71b7ba92ed4d143bf1ff3e6a38ab362a56e8775f
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Tue Oct 30 15:41:02 2012 -0700

    msm: vidc: Add support to process resources request from HW

    Add support to process resources request from HW based on
    smooth streaming flag.The client is updated with the
    updated resource request.

    Change-Id: Id95321f6894a903c23d25ee33835bcd1efb36d29
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit c1a7261dcaed73a2023ed4f43df12a13cc77991d
Author: Stephen Boyd <sboyd@codeaurora.org>
Date:   Thu Jul 5 14:07:35 2012 -0700

    msm: ramdump: Add parent link to miscdevice

    Set the parent of the miscdevice created in
    create_ramdump_device() to be the platform device for each
    processor. This allows us to easily locate ramdump devices for a
    particular processor.

    Change-Id: I7241e57231ad3f6a60d799be094d2b7a7fc40a3d
    Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

commit 77db8bb9741de2d09f52947a7f6dff89110f3f99
Author: Stephen Boyd <sboyd@codeaurora.org>
Date:   Wed Jun 27 15:15:16 2012 -0700

    treewide: Replace pil_get()/put() with subsystem_get()/put()

    Do a tree wide sed to replace pil_get and pil_put() with their
    subsystem counterpart. With all the pil drivers migrated over to
    the new subsystem start/stop API this is essentially a no-op.

    We rename "q6" to "adsp" to be more in line with how future
    chipsets name the low power audio subsystem. This requires minor
    changes to userspace; hopefully no more changes will be
    necessary.

    Change-Id: I22dbbdcf7f5aaaa80394a6d70b5cfc24cdb32044
    Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

commit 6c51b6e489752a0f92e9e446625c79504028ec44
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Oct 15 15:18:04 2012 -0700

    msm: vidc: Add header file for sharing media info

    Create a common header file which can be used across
    mulitmedia subsystems for sharing static information
    between them. One such requirement is to share information
    related to video color formats. This common header file
    avoids duplication of same calculations across different
    drivers and userspace.

    Change-Id: I4cb70c6b2461cc4dfcabcf147f0f314c5cf6a8bd
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 9cb13cccc47d197987f750ad3096aa0dcf583d64
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Oct 29 12:58:57 2012 -0700

    msm: vdec: Handle no-extradata case for video.

    Firmware or client may request for no extradata.
    In such scenarios we have to ignore the extradata
    and let the session go ahead without extradata as
    extradata is not required.

    CRs-fixed: 415351
    Change-Id: I2b58303172552a0e1aa78e71e5b91e2d80d084e9
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 1f0c265bb1da311601f2c1d20baca4506450d1aa
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Mon Oct 22 15:47:52 2012 -0700

    msm: vidc: Add support for dynamic clock scaling

    Adds support for dynamic clock scaling by calculating
    the number of mbs based on the frame rate set by client.

    Change-Id: Ie680bfc4ad536636a1e5793f15efbda1c73e5af8
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 4e303609cf8dc5c340e47224df37f54cf37b90a0
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Mon Oct 1 18:56:34 2012 -0700

    msm_vidc: venc: Release encoder buffers

    Video encoder session cleanup was not done completely, this
    change allows cleaning up of the scratch buffers and ensures
    firmware releases output buffers before driver frees them.

    Change-Id: I08e825376c81311c4235bbf7d6dd81de969bee73
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 74932576309bf985c3b985f2e88912ff90f8ecaa
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Oct 24 18:54:13 2012 -0700

    msm: vidc: Fix iommu unmap and iommu detach order

    Free any outstanding memory allocations and unmap
    IOMMU before IOMMU is detached.

    Change-Id: Id750db5be260cfdb07e4db013635f94bd120a755
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit a2692a1946b0365c6c335315ced32c9ef4f4d201
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Oct 18 19:23:29 2012 -0700

    msm: vidc: Add logs to indicate video open/close

    Add logs to indicate when video is openend and
    when it is closed. This helps a lot in debugging
    complex issues where multiple instances of video
    are running concurrently.

    Change-Id: I043b248a6bf90bd9b328527782b3a406f6b7f577
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 131aaac36440b3a68bfd252c16adf85b55566f9b
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Tue Oct 16 17:30:22 2012 -0700

    msm: vidc: Add support for thumbnail mode

    Add support for thumbnail mode decode. This reduces
    the memory requirements from HW.

    Change-Id: I7f54cc618759b366389e748527b051524fb2c20b
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit e0368f062d399970940f1d16264f1874ac0a392a
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Wed Oct 17 16:41:14 2012 -0700

    msm: vidc: Change V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_IFRAME to button type

    V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_IFRAME should not be a boolean type as
    subsequent requests for I-frames will be dropped by the V4L2 control
    framework as a duplicate s_ctrl.

    Change-Id: I27b30d8626488dcf7164a4709551d817d607a8d7
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 1efc291329375462538440baca9c47fcfad1aae2
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Jul 25 19:52:17 2012 -0700

    msm: vidc: Add extradata support

    Uncompressed buffers can have extradata associated with
    them. This extradata contains information about the
    uncompressed buffer, eg: interleaving information,
    macroblock error information etc. With this change
    extradata buffers can be exchanged between firmware and
    client. If the number of planes in a  v4l2 buffer are more
    than one, then the last plane is considered as the plane
    containing extradata information.

    Change-Id: I4659d5a5749b0c1f4e32e17ccd5aecfbc4600f62
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit ed8ad3cee7f2a51f1b33cd22f8c391b1ff036727
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Tue Oct 23 16:17:50 2012 -0700

    msm_vidc: update performance calculations in video driver

    Performance calculation were not accurate, resulting in incorrect
    fps reported by driver. Updated the calculations to reflect correct
    numbers.

    Change-Id: I74813aa902332cb2fc088f353e3d1e47e223791d
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit cd2c13431063c20104ee1a07a60280b57f1d2623
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Thu Aug 23 11:59:09 2012 -0700

    msm: vidc: Add support to process HW Error

    Add support to process Watchdog timeout and sys error
    with SSR framework and reporting event bck to userspace.

    Change-Id: Ie12a15044dd01cb0ceab82d4f29d612db2955b8d
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 9df72b18a3fed5b0752812978a4713631d5eaed3
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Tue Oct 16 15:57:04 2012 -0700

    msm_vidc: update bus bandwidth selection for video driver.

    Incorrect bus bandwidth was selected for video encoder or decoder,
    resulting in performance being lower than expected. This change picks
    the correct value when requesting bus bandwidth.

    Change-Id: I76d8bc4e77430337e26aa394e6a3c1d0e5c8b79b
    CRs-Fixed: 406619
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 39f7889bd4d53480867cedd726aaabba4858ef9d
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Tue Oct 16 16:36:25 2012 -0700

    msm: vidc: On session_end_done only free current session context

    Currently, the msm_vidc driver is freeing the contexts of all the active
    sessions, causing hanging pointers and general memory corruption.  We
    should only be closing the context of the session that is ending.

    Change-Id: Ie7bbd5a5b31f79a3ed80bca84b4ec0cc7e6bb013
    CRs-Fixed: 407718
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit ae3e91a67f5d8e4a6aae55a9f7a0d9aad6b71215
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Fri Oct 12 17:37:37 2012 -0700

    msm_vidc: mask extra interrupts from video hardware.

    video driver was registering to receive all interrupts from video
    hardware, so video hardware raised multiple interrupts when
    processing a frame. This change masks interrupts which do not convey
    video information, thereby reducing the number of times video hardware
    interrupts the host.

    Change-Id: I861cad7cc217241bb804b808796863f566aedf6c
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 000b382c1ee984de63c1b63b8b88c01ed04282bd
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Oct 11 18:20:58 2012 -0700

    msm_vidc: reduce excess logging in video playback.

    Excess video driver logs sometimes causes system to crash/freeze UI.
    This change reduces the logs printed during session and fix incomplete
    messages.

    CRs-fixed: 408825
    Change-Id: I1da2f077e2254a813655792805d9bd26b1d63495
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit cde7852e58e7e6d55edca090d63a3b371e7336a8
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Jun 28 18:14:50 2012 -0700

    msm_vidc: enable firmware debug logs from video driver

    Firmware messages don't get printed to console. This change enables
    firmware debug messages and prints them as part of video driver
    kernel messages.

    Change-Id: Ie59a11ee127bbdf87e9ee1983ab52720aa427d27
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit ee1973ba0ea6c63ca781fd6a233411212df3c934
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Wed Sep 26 18:24:34 2012 -0700

    msm_vidc: Enable performance metrics calculations in video driver

    Add support for measure video core response time for command/data
    calls issued from driver

    Change-Id: I2d08cb65b2ef8cf2f977ae13870956413bd8e5fa
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 45648a4a5199e3fb2c8f9aca9e8c003d477c8aaa
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Wed Oct 10 18:58:54 2012 -0700

    msm_vidc: venc: set resolution on firmware in set_format call.

    Resolution information was saved in driver and set to firmware once
    before encoding starts, in one use case this lead to corruption. This
    change configures the firmware to update the resolution everytime
    client updates resolution.

    CRs-fixed: 408761
    Change-Id: I6b43d59c7e44b2e4f48d1fda061f006dc0faca55
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 6a8803fded6d41363efac47314efeb3f142248bc
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Tue Oct 9 18:41:49 2012 -0700

    msm_vidc: venc: set slice size to firmware.

    Slice size information was not propogated to firmware resulting
    in slice size = 0 for all slice enabled encodings. This change
    configures proper size to firmware.

    Change-Id: Ie87ac63791e3473aab98a7186364befbb2156128
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 1586fee7cb9f25516a4290a45a42b9568b9ebee2
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Oct 4 16:21:36 2012 -0700

    msm_vidc: venc: set correct count for input buffers.

    Input buffer count was not set properly for video encoder driver
    resulting in failure to start encoder session. This changes configures
    the encoder to pick maximum of the configured buffer count and updated
    buffer count.

    Change-Id: Ifc25eb930be758bf690d697638255a312b2f39c6
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit acff683704e6c952b6c8007f14f2f477db24118e
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Sep 27 18:06:01 2012 -0700

    msm_vidc: change logging mechanism in video driver

    video driver was logged all messages below given level, this change
    allows selective logging, and enables error and warning messages.

    Change-Id: Idf19bf9f4aa3d729506a32a5e781af7c7d6aa8ad
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 9105d4246637072b7cc9fe4a30cedf7889101324
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Thu Oct 4 18:11:24 2012 -0700

    msm: vidc: Adds fix to set the correct MPEG4 profile

    Fixes a mismatch of profile values between HW
    and vidc driver.

    Change-Id: Id82ab02445fa3f35e4dec5a1553fbecde6b307f7
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 99686cafd940a4734b527117a13a9100e6c24a68
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Oct 4 10:14:21 2012 -0700

    msm: vidc: Clear pending buffer queue on flush

    If flush is called before streamon but after queuing the buffers
    then driver needs to return back the queued buffers. This change
    takes care of that scenario.

    Change-Id: Icab901ee0016c8033d113bc049cc1abbe01ed9e9
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 76b9b4d881b32c13356c736a07b2ee363d5ddd9b
Author: Mitchel Humpherys <mitchelh@codeaurora.org>
Date:   Mon Sep 17 14:33:22 2012 -0700

    ion: remove obsolete ion flags

    The symbols CACHED and UNCACHED have been replaced by ION_FLAG_CACHED
    upstream. This removes them from the kernel.

    Change-Id: I565dcc4595298ce6a0e81dd8cb98b86a1b38fdb2
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 911b4b702a63fbd241863966cad45909e40e4665
Author: Mitchel Humpherys <mitchelh@codeaurora.org>
Date:   Wed Sep 12 14:42:50 2012 -0700

    ion: change ion kernel map function to not take flags argument

    Buffer flags are going to be specified at allocation time rather than
    map time. This removes the flags argument from the ion kernel map
    function.

    Change-Id: I91589ca7b1ab142bb5ac8e6b0f4c06fa1305f23a
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 7d72bad55a0e03392d81eee77a9a8c9df6b73a9a
Author: Hanumant Singh <hanumant@codeaurora.org>
Date:   Wed Aug 29 18:39:44 2012 -0700

    ion: Port heap mask change to ion

    Heap mask field passes as argument at allocation time to specify ion
    heap.

    Change-Id: I8881dfc491dc0f8f70581ad97b35756a6a33dd6d
    Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 227a6582d86ae918d290c208f30246b3756084fb
Author: Mitchel Humpherys <mitchelh@codeaurora.org>
Date:   Tue Sep 11 15:59:11 2012 -0700

    ion: change ion buffer flags

    This syncs up our ion buffer flags in ion.h with upstream (using
    ION_FLAG_CACHED instead of CACHED and UNCACHED).

    Change-Id: I0bca35210da403098a12747ddadb51fa399f8758
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit a67f6464ffbeccb97cc5c27cc704881bc8324e42
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Sep 19 22:02:49 2012 -0700

    msm: vidc: Protect queued buffers list with lock

    Queued buffers list can be accessed across different
    threads so it should be protected with a lock. Without
    proper locking the lists might get corrupted resulting
    in frame drops and crash eventually.

    CRs-fixed: 400702

    Change-Id: Ie316b6744db342203e23a83bf6194983ea5eecca
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit cc2bb4d2164217b82fd0e36a84b1a8f309005ea9
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Sep 24 16:17:45 2012 -0700

    msm: vidc: Fix release buffers to prevent mem leak

    Fix a bug in release buffers and clean up code to reuse already
    existing functionality. Without this fix release buffers was
    failing which might result in memory leak.

    Change-Id: Iedaa19657b69883dd0c66654ada8f0e5bf2ec03f
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 2e542e4409b7a351dbfbe53d2256c3511cb63579
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Sep 24 14:28:19 2012 -0700

    msm: vidc: Unmap iommu in non-atomic context

    ion_unmap_iommu should not be called in atomic context.
    This change removes spinlocks around this call. spinlock is
    needed to protect the addition and deletion into the
    queues and it is not required while unmapping/freeing
    memory.

    Change-Id: I8a35f8d9c18302ce4761eda25f4238b66e948430
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 8c5f34fb8a5c98a827f0c70839cee3c2bfaf1d28
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Fri Sep 14 17:13:38 2012 -0700

    msm: vidc: Configure codecconfig param on video core

    When firmware sends syncframe, codecconfig is also sent along,
    this is default behavior. This means codecconfig is being sent
    multiple times resulting in parsing errors in container. This
    change configures firmware to not send the codecconfig data with
    syncframe.

    CRs-fixed: 396716
    Change-Id: If89aee60a16e422217ac9a7e7415d6448a068966
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit bddb1ebee894aa085db755bfd889b798f74e37c6
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Sep 24 18:01:57 2012 -0700

    msm: vidc: Fix IOMMU pagefault for long clips

    Shared command/message queues are circular, so if they get
    full driver has to write/read into them from the beginning.
    The address used to write/read from beginning was not the
    kernel virtual address causing IOMMU page fault.

    CRs-fixed: 400747
    Change-Id: Ie414f75370c31c8a4fb1bf7c879d1d0f4d5c7ea0
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 86449e6b5f9a803c730ef3988d67378b3d57c86e
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Wed Sep 19 15:24:33 2012 -0700

    msm_vidc: venc: Change default fps for Video encoder.

    V4L2 framework will not pass the fps information to firmware
    if new fps = current fps. This resulted as incorrect rate
    control setting to firmware. This change fixes the issue.

    CRs-fixed: 396793
    Change-Id: I69b66c2d06330cc00857a612f1f4e1f28a2eb2ec
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 00dd73ca7b3b8a0083596354dfe0295694399fd0
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Sep 5 23:13:14 2012 -0700

    msm: vidc: Adds support to release buffers

    Adds support to release internal,scratch and output
    buffers at the end of the video playback and return
    them to userspace.

    Change-Id: Iffd2a09146f4129a97a9566432be8ddde9442308
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 106f5182c1344abff687477a7feabb231f7856ab
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Fri Jul 6 15:08:22 2012 -0700

    msm: vidc: Add msm_vidc_wait as a poll interface for kernel clients

    Add a new interface msm_vidc_wait that is similar to msm_vidc_poll in
    functionality, except intended for kernel-space clients.

    Change-Id: Ia08f228f9865dcb8c92ba8fc04692e4b0184daea
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 7d12f84196c9f2f29f7ca92759502fe407bebe30
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Tue Jul 3 15:10:49 2012 -0700

    msm: vidc: Expose additional vidc interfaces

    Add additional interfaces to msm_vidc so that kernel clients may use
    them.  To enable this, msm_vidc_open() interface has been modified such
    that internal structs do not need to be exposed.  Furthermore, some
    functions such as (un)subscribe_event() have been moved from the v4l2
    layer to the vidc layer.

    Change-Id: If29154b8f542835e6c4ebf0be4c654474038c1ec
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 2e2c63936972bbb4f004e2499485e2c67e62293f
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Sun Aug 12 01:43:14 2012 -0700

    msm: vidc: Adds support for VC-1 MP and SP support

    Adds support for VC-1 Main and Simple profile decoders
    by adding VC-1 decoder entry in vdec formats struct.

    Change-Id: I7b2bbaee6b84e7198f825a80aeb7c52a6271a9a5
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit ff92804047a2e3f7d75f7fc661779a93f9bc2c24
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Sep 14 18:33:45 2012 -0700

    msm: vidc: Reduce video core clock for encoding

    After performance and power analysis, video core clock
    should be reduced to 133MHz for 1080p@30fps load. With
    this clock setting, camcorder end to end performance is
    not impacted.

    Change-Id: Iee0fa9ce20181935faceb7b833b1aa510bbc6976
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit b717b9d6825305d55b3aff75545afbd283ee0714
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Sep 14 12:00:45 2012 -0700

    msm: vidc: Camcorder performance enhancement

    Set VBIF priority register to achieve 1080p @ 30fps
    camcorder performance. This register setting has been
    recommended after performance testing.

    Change-Id: I5feb128b0ff460f3638edb6ca644efbfb3b03283
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 071b9bef721194780cea699b31cdff7d19921052
Author: Mitchel Humpherys <mitchelh@codeaurora.org>
Date:   Thu Sep 6 10:45:28 2012 -0700

    msm: vidc: include msm-specific ion header

    All msm_ion clients need to use <linux/msm_ion.h> instead of
    <linux/ion.h>

    Change-Id: Ie44e862e13d0929b6ef6e73a74a7bb19a5c6319e
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 4e042b585af2a84e5dec89aba56219dfcdebbec5
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Sep 12 13:41:39 2012 -0700

    msm: vidc: Remove HAL_MSG_* macros

    Video driver no longer uses HAL_MSG_* macros
    for debug messages. Instead dprintk is uses.
    Removing these macros as they are deprecated.

    Change-Id: Id3949b28c1fcd85803c061768e59da79218171f0
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit aaeffd29ab225cd12f30c9dbd581b015ffaf2cab
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Tue Sep 11 17:19:55 2012 -0700

    msm: vidc: Reduce OCMEM bandwidth request.

    Reduce bandwidth request for OCMEM as same
    performance is achieved at lower bandwidth
    numbers.

    Change-Id: I2e1f1560681f86316ecccb08a9daabf46b70cf3e
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit e76323d5edd85dc16a21c1ebee2044f370292f14
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Sep 10 18:03:48 2012 -0700

    msm: vidc: Remove spinlock around ocmem_free

    Spinlock around OCMEM free is not needed. This
    is already being protected by a mutex.

    Change-Id: I9fa370047433812a6b267e24fb4a71ab5443ad58
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 934e81ed00866b905a5e6a8ce53fd45699173dea
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Mon Sep 10 16:56:45 2012 -0700

    msm_vidc: Fix bus bw request for lower resolutions

    Fix bus bw request for lower resolution and send
    proper device address to firmware while releasing
    buffers. With this change clips less than VGA
    resolution should work.

    Change-Id: I96f3ef4185f1ba88931f92a859c3fd92d6e13b63
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 15e870b358cbe8f9e75209448ef6a92f8e4793b3
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Sep 10 15:30:23 2012 -0700

    msm: vidc: Encoder performance tuning.

    Set VBIF registers and clock changes to improve
    encoder performance. This is required to achieve
    1080p 30fps encoding.

    Change-Id: Iacb66e70a3988ca114b23ff002aa46d0fbadeb54
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit b673450004ebe1e44748c1f414900b114d745cb1
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Fri Aug 24 13:00:22 2012 -0700

    msm_vidc: Changes to enable Camcorder

    - Add get_seq_hdr support in driver
    - send KEYFRMAE flag with first frame data

    Change-Id: I57c9097f3f54e63bb8e46629aed987cee054c816
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit f1a7cffbda1049a005ca7c028bfd305fc95f6760
Author: Blaine Dietrich <blained@codeaurora.org>
Date:   Mon Jul 23 12:14:18 2012 -0700

    msm: vidc: Enable/disbale debug messages

    Adds support to enable/disable debug messages
    from debugfs so that messages only upto a
    desired priority can be enabled. By default,
    only error messages are enabled.

    Change-Id: Id133c3f109d227862d1fa580f3b5df4cbbc37e11
    Signed-off-by: Blaine Dietrich <blained@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 7ceb94edc3f97df463b6e1c3e9062760fb7f9ad2
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed May 23 20:19:54 2012 -0700

    msm: vidc: Add debug support for video driver

    Add debugfs and other debug support for video
    codec driver. This creates a debugfs entry
    on device for video and basic information
    about video playback and encoding can be obtained
    from the debugfs files.

    Change-Id: Id4d3d7f6e38bb4993587621ecb8e5dc6bbeb00fd
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 4cd435dd3e4d0157c8d8a692ea66a39d826c3351
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Aug 23 12:59:24 2012 -0700

    msm: vidc: Add flush for video codecs

    Add support to flush input/output buffers. This will flush
    the buffers being held by firmware or video driver and
    return them to client. This operation is usually used
    by an application during seek operation or while
    closing the driver.

    Change-Id: I61d3d8f94eeeeeea0e4c40460bebfd7873f428df
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 9f2303869d0d81b8e09a27e8c3fb2e5057d25dbb
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Fri Aug 24 11:48:41 2012 -0700

    msm: vidc: Pass on the CODECCONFIG flag to core

    In case of SPS/PPS buffers in frame by frame mode,
    the respective buffers must be marked with the
    CODECCONFIG flag.

    Change-Id: Iba29fc03ec736280f2babefc68d3380e856e3006
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit be3d0f7d01f715a642b87f602a2b97f9da6d23f5
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Aug 29 21:10:53 2012 -0700

    msm: vidc: Reduce calls to get buffer requirements

    Reduce calls to firmware to get buffer requirements.
    This call is very expensive causing too much delay
    in video startup. Only calling this when necessary.

    Change-Id: I01f59b5402e82a79742f257d39cda1c9504e6dd0
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit d40bd3f22bec010057a7f26d43f0c8f84edd79fa
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Aug 31 13:22:32 2012 -0700

    msm: vidc: Tune input buffer count for performance

    With just two input buffers, video hardware stays
    idle quite often waiting for data. With the new
    input buffer count venus idle time is reduced and
    improved performance is observed.

    Change-Id: Ia44e106e4c8cf46ebcae9c89054508337c23a6cb
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit cdf8d0cf7bb1e8313d2e5f949ef00b59ef797553
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Tue Aug 28 12:07:36 2012 -0700

    msm: vidc: Video performance tuning.

    Setting vbif registers as per the performance
    analysis to achieve better video performance.

    Change-Id: Id12ebb93ea3bea6e599b40bebf16b0cab16a2bdf
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit a31f9e6ba2087844b3c124aa961463fc99ec95ab
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Aug 20 22:49:18 2012 -0700

    msm: vidc: Fix clock and bus scaling

    Fix bus and clock scaling requests by video
    encoder and decoder. Updated bus bandwidth
    numbers after performance analysis.

    Change-Id: I17a6e857679e88afb88a0b31e9e1a0f4da3d995d
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 20d2801618a3ec248fa0188f9494a91f0e29f4d5
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Thu Aug 23 14:07:10 2012 -0700

    msm: vidc: Always map into IOMMU as uncached

    If buffers provided by userspace are cached, mapping into IOMMU with the
    same flags results in a failiure as cached IOMMU mappings are not
    supported.  As a result, map all buffers as uncached.

    Change-Id: I483eab817b330e4aa7e232b30db2ae0d56730d8b
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 39a8e71631e6658e0909df3573b44694b0df0c96
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Fri Aug 17 16:39:51 2012 -0700

    msm: vidc: Return timestamps correctly back to the client

    Propagate the timestamp client provides on the OUTPUT port to the
    CAPTURE port.  Additionally, use kernel provided functions to convert
    the timeval struct to a 64 bit value rather than requiring the clients
    to set the timestamp within the tv_usec field.

    Change-Id: I19b8b953c837199019d7370f8bf3afec88a0d00d
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit cd111c7a4710f08ea28e4cdb17d6e6e088d38d60
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Aug 16 22:39:02 2012 -0700

    vidc: fix NV12 buffer size calculation in encoder and decoder.

    Buffer size calculation in driver and firmware is different. This
    results in inconsistent behaviour for different resolutions. This
    change calculates buffer size as in firmware.

    Change-Id: I9dca9e0e8729eb4e578de63dc43c01dd65c3f3be
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 3dbe9997ba80f8fcd7e90a91c8dc8154a991ff07
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Mon Aug 20 12:22:57 2012 -0700

    msm_vidc: Fix setting queue size to firmware.

    Incorrect queue size was being set to firmware. This patch fixes the issue.

    Change-Id: Ic0ab9384d364f70cf06c352331887dfcdf6592c4
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 3475a6e57c17051ffe2180f02f38957e36a912c0
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Fri Aug 10 21:34:03 2012 -0700

    msm: vidc: Honor client's request for more buffers

    The driver should allow the client's request for more buffers than the
    minimum rather than enforcing just the minimum required by Venus.

    Change-Id: I8c10372b1ffef55d0e73b824b13ad80de2446f23
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 564814bd20e01d1d49a105df00604ab90b418179
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Aug 20 11:09:57 2012 -0700

    msm: vidc: Fix for IOMMU mapping.

    Same memory region was being mapped multiple times.
    This fix avoids this scenario and makes sure that
    that we map proper size and single fd is mapped
    and unmapped one time only.

    Change-Id: Ibba932456792d5964213fe93db2c6101ad94b74c
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit e38c55f7034c140d6bdd57bc7016107e3746e72f
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Aug 16 19:37:28 2012 -0700

    msm: vidc: Add support for cached ion allocation

    Add support to allocate ion memory from cached
    or uncached region in video driver. Also, Clean and
    invalidate caches for input, output, shared command
    memory and internal buffers incase they are allocated
    from cached region.

    Change-Id: Id1ac9587bfef8d2d0e2a3d3d30f30e39de10665e
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 8383c095459de560e644c7fa1f96dd8dcc025983
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Aug 16 22:30:09 2012 -0700

    vidc: Disable venus VBIF dynamic clock gating for video core.

    Video core behaviour was inconsistent for different resolutions. This
    was due to dynamic clock gating for venus VBIF was enabled. Disable Venus
    VBIF clock gating to prevent this inconsistent behaviour.

    Change-Id: Id7efd4b7f922efcb77c729f1dc119b1549cb8d74
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit cbad85b92cfe6e487c1da0c723f3e94206690a0c
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Fri Aug 17 14:38:53 2012 -0700

    vidc: Use correct port setting for encoder during prepare buffer.

    When prepare buffer was called for encoder, the port configurations
    were swapped. This change corrects this error.

    Change-Id: I927cf66666dd02e0f4abbdc9d7be561a857ab2b0
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit c71662f18efbbd44270df8c81571c73ea98a980a
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Aug 16 17:49:28 2012 -0700

    msm: vidc: Separate partition for shared memory

    Create separate partition for shared command
    queues. Virtual device addresses for shared
    command queues need to be from upper 16MB
    region of mon-secure virtual device address
    space. This change creates a partition to
    ensure this.

    Change-Id: Iba22daf93b7d08c70f43685de7182a2f235a7690
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 443e6348f76663fd0d590c3fe446ec3fda838854
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Mon Jul 30 00:48:07 2012 -0700

    msm:  vidc: Adds support for Rate Control

    Adds support for Rate Control by setting correct
    RC Mode and bit rate.

    Change-Id: I0307417f3a517e0aa40f67c5d4835db3ef4ea444
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit e541526f3b35b02b25831c14cbc4f43baf6310df
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Aug 1 16:21:08 2012 -0700

    msm: vidc: Adds support to send new command

    - Adds supports to send DECODER command to
    decoder which inturn used to CLOSE the instance.
    - Adds supports to send ENCODER command to
    encoder which inturn used to CLOSE the instance.

    Change-Id: Ia6037fdf66824538124f775442150b7a4ed201b8
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit cd9383f390ebce77c88cd6acb1345fee5b0a497b
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Thu Aug 2 15:58:26 2012 -0700

    msm: vidc: Adds support to send frame rate to Video Hardware

    Adds support to send frame rate to Video HW in right format.

    Change-Id: Ifba83310cb88e6ec898266f9d24bb157ae63aad6
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit d075233da173e5ea1e64f7558d3b3fc8f8a74e4a
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 11:14:21 2012 -0700

    msm: vidc: Adds error check for controls

    - Adds Error check before calling control to make
    sure that Venus is in right state.
    - Adds supports to calculate right scratch buffer length.

    Change-Id: I83043a87859d7bb31c683e3ad19a4a23fb519747
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit d39507a2afd46a2caa4460699a72d0ee1287c687
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Jul 30 17:31:37 2012 -0700

    msm: vidc: Allocate persist buffers.

    Persist buffers are needed by decoder/encoder
    in some cases. These buffers are mandatory and
    cannot be ignored. This change allocates persist
    buffers according to the requirement by video device
    to avoid hangs.

    Change-Id: I961bb1abe45dba1cbc770edef2277f33ea186546
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit c2a557ca7c83963156770f6e4212619969c29714
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Aug 3 11:39:47 2012 -0700

    msm: vidc: Fix scratch buffer allocation.

    In some cases, firmware is reqesting driver
    to allocate one scratch with size zero,
    eg: if height and width is set to zero on
    firmware. This change handles this scenario
    appropriately to avoid kernel panic.

    Change-Id: If670f91ef600678af8e246934f685defcb7fdfeb
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 12d8eefc7bcdb1dc4f65b0943e8ea1f1e8b9ea31
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Aug 3 17:45:53 2012 -0700

    msm: vidc: Set proper height and width.

    Set proper height and width on firmware.
    Proper height, width was not getting set
    on firmware resulting in firmware reporting
    bad buffer requirements which caused hang or
    crash during port reconfig.

    Change-Id: I4097e0219a1df423fdd0ec9421800635525cf8c4
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit b17f8aa08ff5d4c7acff0dd3f07019f1755be7b6
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Mon Jul 30 17:16:32 2012 -0700

    msm: vidc: Specify the number of planes in buffer to client

    When a V4L2 client sets or gets the format, driver is supposed to report
    back the dimensions, the size of the buffer, and the number of planes
    contained with in the buffer.  The former two were being reported back
    to the client, while the latter wasn't.

    Change-Id: Ie225e108ce90cc40823ee9c0f13aeb7d054f5bdb
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit bc9f60a99f7d6130e6d8028e340a421072498d3f
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Tue Jul 17 01:23:42 2012 -0700

    msm: vidc: Uses on-chip memory for video codecs

    Video driver allocates on-chip memory (OCMEM) and
    hands it over to the video hardware for internal usage.
    Video encode/decode performance improves with OCMEM.

    Change-Id: Ic6e35278db24cedc003aa33d5e3cef52172e2254
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit cb722d6f8f9a27cd9d579bc8821692b6b03beefc
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Jun 28 19:35:22 2012 -0700

    msm: vidc: Adds bus scaling for video codecs

    Adds bus scaling so that the bus bandwidth
    can be voted for according to load. This
    optimizes power consumption during video
    encode and decode operation.

    Change-Id: I4b7123e9ae2e429ffe9bf4636d633284768e1b33
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 6a8d04ce4f9fa9b7ea96a7009120c9bcee295627
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Tue Jul 17 19:23:05 2012 -0700

    msm: vidc: Change configuration flag for video.

    Change kernel configuration flag for video
    on 8974 so that it does not interfere with
    video drivers on other chipsets.

    Change-Id: I74fa8f0ed7be713893b9e280bb9b77606bc5c786
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 94b221b88d8274f1d04839e52ad3b09fc5aa5fe1
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Jun 25 18:50:13 2012 -0700

    msm: vidc: Adds clock scaling

    Video driver manages clock rate according
    to the increase in load on video core. Clock
    is scaled as per number of macroblocks
    decoded/encoded per second. This makes sure
    that the power consumption and performance is
    optimal.

    Change-Id: If8aede0e3048cdc9bcdf14ce0c239a58bdd5d263
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 0ebb19b6f630f7ee2338504b37db278b617d2a5e
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Fri Jun 22 01:32:37 2012 -0700

    msm: vidc: Add controls specific to H263

    Userspace requires controls to set profile and level values. Hence
    expose V4L2_CID_MPEG_VIDC_VIDEO_H263_PROFILE and
    V4L2_CID_MPEG_VIDC_VIDEO_H263_LEVEL.

    Change-Id: Id2b5d4ade8dda1a32b11820936532300b18c37ac
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 68398a4f0e87aa7285ccf55d1e087f15c32aedca
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Jun 22 18:36:12 2012 -0700

    msm: vidc: Download firmware using PIL.

    Video driver uses PIL and IOMMU to download video
    firmware.Video firmware is downloaded during the
    start of video session using PIL apis.

    Change-Id: If285e9b6df57ecdfa379fa82b9eef542e6aa9bba
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 9c4d9599ad8d57a4fa860c52ac892441a5e605bc
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Sat Jul 14 01:27:35 2012 -0700

    msm: vidc: Adds support for high bit rate and frame rate

    Increased the maximum value for controls
    V4L2_CID_MPEG_VIDEO_BITRATE and
    V4L2_CID_MPEG_VIDC_VIDEO_FRAME_RATE thus by
    increasing maximum supported frame rate and bit rate.

    Change-Id: I6330d178d12652683cce793b7544572594b5dabf
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 951c02de0409e5e56ce2cfe0c06989e2aec1814a
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Jul 11 12:19:42 2012 -0700

    msm: vidc: Adds support for dynamic I frame request.

    Adds support for dynamic Intra frame request by setting
    correct command packet size to video hardware.

    Change-Id: Id851345176bfececae87927fcd61cc9e3f028828
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit c5041daa75ffab4ce8cffb222298bd958fec5ffe
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Jul 18 15:44:57 2012 -0700

    msm: vidc: Adds support for high bit rate decode

    Adds support for high bit rate decoding by
    increasing the input buffer size to hold
    large input frame data.

    Change-Id: I06f8bebddf879104761956bd982c44d854edca2b
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit a46f06badbe9da62bb64790d45c34293b3831a00
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 12:23:48 2012 -0700

    msm: vidc: Adds support for VP8 Encoder.

    Adds support for VP8 video encoder by adding VP8
    entry in venc formats struct.

    Change-Id: Icb9fbc049aadd226c7f803ad938d1d76cbb760f4
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 40c3ae806210f2e4576e8fa44fb871124a8fbcc7
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Jul 9 15:23:02 2012 -0700

    msm: vidc: Fixes back-to-back video decode/encode.

    Fixes a bug introduced in recent commit because of
    which only one video session worked. Next video
    session always failed when client tries to open
    the video device.

    The commit ID caused the issue is
    fe72c45cf670cb0fafb04a6a2fa6a1aa428435c6

    Change-Id: Ib0cbe7cac5189cf617e8b3bcfc549e022e88fd46
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 1e8ddaef241c09ab7684fd6dea4a7952c3d57e42
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 12:13:06 2012 -0700

    msm: vidc: Adds support for VP8 Decoder.

    Adds support for VP8 Decoder by adding VP8 codec
    entry in vdec formats struct.

    Change-Id: I93bca63e18ae2ba2a125e76584d230c0af1cc33a
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit df7532d69948f453d66f59d0303fe116e3ad8919
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Mon Jul 9 11:21:16 2012 -0700

    msm: vidc: Migration to new firmware version.

    Adds support for the new firmware version by incorporating
    the interface changes between driver and video firmware.
    These changes make the driver compatible to new firmware
    version.

    FW_VERSION: 100100

    Change-Id: I04e9457ac8a85a070f2e4c738ad3e4fc9cbfbaeb
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 1b03554c22ee7d6a90f1a281072dbb73ee831535
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 11:02:38 2012 -0700

    msm: vidc: Adds support to send individual controls.

    Adds support to set individual properties to Venus by
    calling controls separately.

    Change-Id: I4af3176ee009f202e62d566de3ce859b6a8d36c2
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit b040a018b5ec2f054e58b6a3b2806c161fd9d22a
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 11:29:15 2012 -0700

    msm: vidc: Adds support for Intra Refresh

    Adds Support for Intra refresh by setting
    default values and calling right set_property.

    Change-Id: Ibc04ec195b5265a1db60befb8109693a41f8fe51
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit d8c98c33c58f5f78e7fb60a678fac69b33424dc0
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Fri Jun 15 18:32:52 2012 -0700

    msm: vidc: Fixes polling on video driver.

    poll should return all the available events
    in one call. This change implements this
    behavior.

    Change-Id: I498b621cc5d8fca820376109ca4a5f1bd4c492b2
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 2bf4fb12fdfbfe5552039c6d9d272fdd0c95937c
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Wed Jun 27 20:42:33 2012 -0700

    msm: vidc: Amend buffer size calculation

    Amend the input and output buffer calculation to
    reflect what the Venus core expects.

    Change-Id: Ib3c600d0e838525e3a82a1b2c05803f86075ba15
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 98dfb65a7644809b8868809262a8fbf4937aa915
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 08:19:37 2012 -0700

    msm: vidc: Adds support to parse SEQ_CHANGED cmd payload

    Adds support to parse the payload of command
    evt_seq_changed to know about resource request.

    Change-Id: I483954b0453a84be26e3d180f4f18bef042ab409
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 3a323802585b92a821aa79e368611d7c0cb407b3
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Fri Jun 15 15:15:42 2012 -0700

    msm: vidc: Add input buffer flushing support

    Flushing the core is now done with the V4L2_DEC_QCOM_CMD_FLUSH ioctl
    rather than V4L2_DEC_CMD_STOP.  The latter is confusing and the
    arguments specified by the V4L2 spec do not allow for flushing the input
    and and output buffers seperately.

    Change-Id: I53e18e06c4e09ee8496bdcc337b4798f22911708
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit 1fc82a278c42f755e65dc909baf2326a3a6e142e
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 11:38:51 2012 -0700

    msm: vidc: Adds Profile and Level support

    Adds support for Profile and Level support by setting
    default values and calling set_property.

    Change-Id: Ied289779bca6441c5cfdde7c766c02c14c8bce23
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit e29238b519a7c3b210ceab89029baf0498f6328d
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Fri Jul 6 12:04:17 2012 -0700

    msm: vidc: Adds support for VC-1 decoder

    Adds support for VC-1 decoder by adding the VC-1 Decoder
    entry in vdec formats struct.

    Change-Id: I4a5a278a93c252f4e3a16eb004d06d72dba6e491
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit b361d7772dffe94636c53ea0da113cfc6637fab7
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Thu Jul 5 23:26:55 2012 -0700

    msm: vidc: Adds new event type

    Adds new event type to convey about the resources
    requirement.

    Change-Id: I7ea67231c247dc983463a02b828c10adc486b60d
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit b14ed96f74b1258b1f102831a2b0ccd56f991132
Author: Laura Abbott <lauraa@codeaurora.org>
Date:   Mon Jan 30 14:18:08 2012 -0800

    gpu: ion: Pull in patches for 3.4

    Pull in Ion patches for 3.4 upgrade. Inclues the following
    patches from google:

     commit 7191e9ba25
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon Jan 30 14:18:08 2012 -0800

         ion: Switch map/unmap dma api to sg_tables

         Switch these api's from scatterlists to sg_tables

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 6f9e56945d
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Tue Jan 31 09:40:30 2012 -0800

         ion: Add reserve function to ion

         Rather than requiring each platform call memblock_remove or reserve
         from the board file, add this to ion

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 9ae7e01de1
     Author: KyongHo Cho <pullip.cho@samsung.com>
     Date:   Wed Sep 7 11:27:07 2011 +0900

         gpu: ion: several bugfixes and enhancements of ION

         1. Verifying if the size of memory allocation in ion_alloc() is aligned
         by PAGE_SIZE at least. If it is not, this change makes the size to be
         aligned by PAGE_SIZE.

         2. Unmaps all mappings to the kernel and DMA address spaces when
         destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
         those virtual address spaces.

         3. Makes the return value of ion_alloc() to be explicit Linux error code
         when it fails to allocate a buffer.

         4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
         relavant call to ion_buffer_put().

         5. Checks if the task is valid before calling put_task_struct() due
         to failure on creating a ion client in ion_client_create().

         6. Returns error when buffer allocation requested by userspace is failed.

         Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>

     commit 043a61468f
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Wed Feb 1 11:09:46 2012 -0800

         ion: Switch ion to use dma-buf

         Ion now uses dma-buf file descriptors to share
         buffers with userspace.  Ion becomes a dma-buf
         exporter and any driver that can import dma-bufs
         can now import ion file descriptors.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 0d1259b5f8
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon Apr 30 16:45:38 2012 -0700

         gpu: ion: Use alloc_pages instead of vmalloc from the system heap

         With this change the ion_system_heap will only use kernel address
         space when the memory is mapped into the kernel (rare case).

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit be4a1ee79a
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Thu Apr 26 20:44:10 2012 -0700

         gpu: ion: support begin/end and kmap/kunmap dma_buf ops

         These ops were added in the 3.4 kernel.  This patch adds support
         for them to ion.  Previous ion_map/unmap_kernel api is also
         retained in addition to this new api.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 46d71337f9
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon May 7 16:06:32 2012 -0700

         gpu: ion: Allocate the sg_table at creation time rather than dynamically

         Rather than calling map_dma on the allocations dynamically, this patch
         switches to creating the sg_table at the time the buffer is created.
         This is necessary because in future updates the sg_table will be used
         for cache maintenance.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 903f6c716d
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Wed May 23 12:55:55 2012 -0700

         gpu: ion: Get an sg_table from an ion handle

         This patch adds an interface to return and sg_table given a
         valid ion handle.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

    The commit also includes fixups needed for MSM specific code.

    Change-Id: Idbcfa9d6af0febf06f56daaa6beaa59cc08e4351
    Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

commit 995fd27825c1bb27f0bfa76d4a887dc00cd0f1eb
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Mon Jul 2 12:57:55 2012 -0700

    msm_vidc: Fix decoder output order.

    Decoder's output order was configured incorrectly, this
    change fixes it.

    Change-Id: I523260db33f1df5ffb7c30026683b272c9a05488
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 90ced6e40066e6ed681b78d1689ef9b8e552f0ab
Author: Abhimanyu Kapur <abhimany@codeaurora.org>
Date:   Tue Jun 26 17:41:25 2012 -0700

    msm: 8974: rename copper to 8974

    The official name for copper is MSM8974.
    Switch to it.

    Change-Id: Ifb241232111139912477bf7b5f2e9cf5d38d0f9e
    Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>

commit fe72c45cf670cb0fafb04a6a2fa6a1aa428435c6
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Tue May 29 19:52:00 2012 -0700

    vidc_hal: update driver to new hal interface.

    Update video driver to maintain video functionality with
    new hardware interface.

    Change-Id: I731133ffc4b3633d0c2b55846d983846dfe6930f
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit cf7e27f92a99cdc422d67f6d328c0b910d2bbf9d
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Thu Jun 14 19:05:15 2012 -0700

    msm: vidc: Video driver update to kernel 3.4.

    During the migration from kernel 3.0 to 3.4, V4L2 framework changed.
    This requires changes from video driver. This change makes video
    driver code compatible with kernel 3.4.

    Change-Id: I12fb28e4b7c261c9755fbb62bb6bb8ea299d5272
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit 1c72b395348a0d4944e4f05e2979c80e7f8d8c52
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Wed Jun 20 10:50:00 2012 -0700

    msm: video: Fix compiler warnings

    changed array definitions, #defines and variable repetition to resolve
    warnings in compilation.

    Change-Id: Ic26f1924da389f4a8638728963c6a4c8b2f859d0
    Signed-off-by: Jessica Gonzalez <jgaona@codeaurora.org>

commit 240368102e7f6f23ed70835c97bb4e43effb78cc
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Thu Jun 14 00:26:25 2012 -0700

    msm: media: Adds error check in memory alloc function

    Adds Error check for Zero size.

    Change-Id: Ib450c1c8b34436b6a5d1fdc3c14dbb52c9b3f177
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit a1980a18e0e6f868485b232af83efb58f2b3f004
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Thu May 31 12:31:10 2012 -0700

    msm: vidc: Add support for DIVX 4/5/6

    Add support to the driver to properly configure the Venus core for
    various DIVX formats.

    Change-Id: Ica6411936a09edfc3aa4ca321c781ff22948742a
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit c249b751531d3ca2f5506d083720571cb07fc453
Author: Deva Ramasubramanian <dramasub@codeaurora.org>
Date:   Fri May 18 17:31:03 2012 -0700

    msm: vidc: Add DIVX311 support

    Implement changes in the driver to support decoding of Divx311
    bitstreams

    Change-Id: Ie4e05c9161d89b866f9f36ca1865a9b64bc51240
    Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>

commit e6a37af67ac6f2f9eef441e57d13914b4682e1ef
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed May 16 16:47:54 2012 -0700

    msm: vidc: Removes extradata allocation.

    Reverting extradata allocation added earlier in
    3766b1e6b4dea7dea0abed1e9090390640a12909 because
    extradata allocation is causing a hang in firmware.

    Change-Id: I18854cf19757a01794522da75f066bf1ff5e0aa0
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

commit bff3d1085ec9aeb7942fe76ea3520741061eb1cc
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Mon May 21 14:50:27 2012 -0700

    media: msm_vidc: change encoder output size

    Change encoder buffer size from fixed to resolution based,
    so high resolution input can be encoded

    Change-Id: I572c8c82a649ae11abe1319bb13d24838d6fcfd1
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit cb00cab7f826f54338303bbb8f02ce72cfa05030
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Mon May 21 14:22:55 2012 -0700

    media: msm_vidc: extradata buffer cleanup.

    move extradata buffer cleanup to the end of decoder session to
    enable back to back decoding

    Change-Id: Ib4183c73d083efc26442d42e33dc9e2d476ecc13
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit f2acb8593e9b17c69a4c33dd280ecd7edee3dbea
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Mon May 7 17:44:53 2012 -0700

    msm: vidc: Adds support for port reconfiguration.

    Adds support for port reconfiguration. This enables decoder to
    reconfigure to new resolution or settings other than initially
    configured to continue video playback.

    Change-Id: Id11e973e4cf1a5c7e4ec5544215fe57cb19466be
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit 5b79a3252710683b406c03ab21a808e852cb2962
Author: Praneeth Paladugu <ppaladug@codeaurora.org>
Date:   Wed Apr 18 15:16:29 2012 -0700

    msm: vidc: Adds support for conveying events.

    Adds support for conveying events to userspace from kernel
    driver. This is needed to let userspace/client know of
    any error or other event of importance.

    Change-Id: Ife450b9f5dfe23f07b6f346c8e27c214fc85e083
    Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>

commit a6b8db6c28d6db6409bba8397b28f4b89dfb74ac
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Fri Apr 20 15:20:29 2012 -0700

    msm: msm_vidc: enable msm_vidc driver compilation on 8x74.

    Enables compilation of v4l2 based video driver for 8x74.V4L2 clients
    can use video driver to encode and decode video using hardware
    accelerated codecs.

    Change-Id: If615930ddf72023b2a626af6cca87ebf56ede047
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 9c8bab95ac974600c7809db2fc7b3c35004fd5dd
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu May 17 18:20:25 2012 -0700

    media: msm_vidc: fix compilation issue.

    This file depends on vidc_hal_api.h, which was modified to
    address review comments. The change reflects the fix.

    Change-Id: I2b5a64c28e87f6a1696f86c07d597fc058927e6c
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit d2ab0e33cf250647cccabff1073f736f05c7ee83
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Tue Apr 3 18:40:29 2012 -0700

    media: msm_vidc: add v4l2 controls for video encoder

    Adds encoder specific v4l2 controls in video driver, giving
    flexibility to userspace or in-kernel v4l2 client to change/set
    video encoder properties like  codec, profile, level, resolution,
    bitrate, ratecontrol, framerate to video hardware.

    Change-Id: Ie9d0eed301c3adad20471d8ef93f8087fe9dda15
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 1ccbc9106c61b27462036667e7896bdbe0c7d8fb
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Fri Mar 23 16:26:52 2012 -0700

    media: msm_vidc: add set property support in video driver

    Enables setting video encoding and decoding parameters to video
    hardware. This allows configuring video hardware with userspace
    or in-kernel client settings for codec, profile, level, bitrate,
    resolution, ratecontrol, framerate.

    Change-Id: Ie95674dc4ad50e00d737e765af1382c1397d4442
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 6ab782bdf6385bb325667841b7ee53a62a97dca5
Author: Ashray Kulkarni <ashrayk@codeaurora.org>
Date:   Thu Jan 26 16:58:01 2012 -0800

    media: msm_vidc: Add hardware interface for video core.

    - Provides hardware level interface to perform video encoding
      and decoding.
    - Implements interrupt handling and processing for video core.
    - Packages data to core readable format and processes response from core.

    Change-Id: Ie16796449d2aacf331c7e02b3f0a63175cc5d37b
    Signed-off-by: Ashray Kulkarni <ashrayk@codeaurora.org>

commit 3766b1e6b4dea7dea0abed1e9090390640a12909
Author: Vinay Kalia <vkalia@codeaurora.org>
Date:   Wed Jan 11 18:58:41 2012 -0800

    media: msm_vidc: Add video driver for video core.

    - Adds video encoding and decoding functionality.
    - Implements v4l2 interface based driver for interacting
      with userspace modules to perform video encoding and
      decoding.
    - Implements kernel API for interacting with kernel
      modules like Wifi display(encoder) and V4L2 based
      DVB(decoder).

    Change-Id: Iadb83b60139e659ae7f66e5dc38c46fef52ca99d
    Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>

Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:29:47 -08:00

2513 lines
93 KiB
C

/*
* Video for Linux Two header file
*
* Copyright (C) 1999-2007 the contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Alternatively you can redistribute this file under the terms of the
* BSD license as stated below:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. The names of its contributors may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Header file for v4l or V4L2 drivers and applications
* with public API.
* All kernel-specific stuff were moved to media/v4l2-dev.h, so
* no #if __KERNEL tests are allowed here
*
* See http://linuxtv.org for more info
*
* Author: Bill Dirks <bill@thedirks.org>
* Justin Schoeman
* Hans Verkuil <hverkuil@xs4all.nl>
* et al.
*/
#ifndef __LINUX_VIDEODEV2_H
#define __LINUX_VIDEODEV2_H
#ifdef __KERNEL__
#include <linux/time.h> /* need struct timeval */
#else
#include <sys/time.h>
#endif
#include <linux/compiler.h>
#include <linux/ioctl.h>
#include <linux/types.h>
/*
* Common stuff for both V4L1 and V4L2
* Moved from videodev.h
*/
#define VIDEO_MAX_FRAME 32
#define VIDEO_MAX_PLANES 8
#ifndef __KERNEL__
/* These defines are V4L1 specific and should not be used with the V4L2 API!
They will be removed from this header in the future. */
#define VID_TYPE_CAPTURE 1 /* Can capture */
#define VID_TYPE_TUNER 2 /* Can tune */
#define VID_TYPE_TELETEXT 4 /* Does teletext */
#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
#define VID_TYPE_CLIPPING 32 /* Can clip */
#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
#define VID_TYPE_SCALES 128 /* Scalable */
#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
#endif
/*
* M I S C E L L A N E O U S
*/
/* Four-character-code (FOURCC) */
#define v4l2_fourcc(a, b, c, d)\
((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
/*
* E N U M S
*/
enum v4l2_field {
V4L2_FIELD_ANY = 0, /* driver can choose from none,
top, bottom, interlaced
depending on whatever it thinks
is approximate ... */
V4L2_FIELD_NONE = 1, /* this device has no fields ... */
V4L2_FIELD_TOP = 2, /* top field only */
V4L2_FIELD_BOTTOM = 3, /* bottom field only */
V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
buffer, top-bottom order */
V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
separate buffers */
V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
first and the top field is
transmitted first */
V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
first and the bottom field is
transmitted first */
};
#define V4L2_FIELD_HAS_TOP(field) \
((field) == V4L2_FIELD_TOP ||\
(field) == V4L2_FIELD_INTERLACED ||\
(field) == V4L2_FIELD_INTERLACED_TB ||\
(field) == V4L2_FIELD_INTERLACED_BT ||\
(field) == V4L2_FIELD_SEQ_TB ||\
(field) == V4L2_FIELD_SEQ_BT)
#define V4L2_FIELD_HAS_BOTTOM(field) \
((field) == V4L2_FIELD_BOTTOM ||\
(field) == V4L2_FIELD_INTERLACED ||\
(field) == V4L2_FIELD_INTERLACED_TB ||\
(field) == V4L2_FIELD_INTERLACED_BT ||\
(field) == V4L2_FIELD_SEQ_TB ||\
(field) == V4L2_FIELD_SEQ_BT)
#define V4L2_FIELD_HAS_BOTH(field) \
((field) == V4L2_FIELD_INTERLACED ||\
(field) == V4L2_FIELD_INTERLACED_TB ||\
(field) == V4L2_FIELD_INTERLACED_BT ||\
(field) == V4L2_FIELD_SEQ_TB ||\
(field) == V4L2_FIELD_SEQ_BT)
enum v4l2_buf_type {
V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
V4L2_BUF_TYPE_VBI_CAPTURE = 4,
V4L2_BUF_TYPE_VBI_OUTPUT = 5,
V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
#if 1
/* Experimental */
V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
#endif
V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
V4L2_BUF_TYPE_PRIVATE = 0x80,
};
#define V4L2_TYPE_IS_MULTIPLANAR(type) \
((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
|| (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
#define V4L2_TYPE_IS_OUTPUT(type) \
((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
|| (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
|| (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
|| (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
|| (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
|| (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
enum v4l2_tuner_type {
V4L2_TUNER_RADIO = 1,
V4L2_TUNER_ANALOG_TV = 2,
V4L2_TUNER_DIGITAL_TV = 3,
};
enum v4l2_memory {
V4L2_MEMORY_MMAP = 1,
V4L2_MEMORY_USERPTR = 2,
V4L2_MEMORY_OVERLAY = 3,
};
/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
enum v4l2_colorspace {
/* ITU-R 601 -- broadcast NTSC/PAL */
V4L2_COLORSPACE_SMPTE170M = 1,
/* 1125-Line (US) HDTV */
V4L2_COLORSPACE_SMPTE240M = 2,
/* HD and modern captures. */
V4L2_COLORSPACE_REC709 = 3,
/* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
V4L2_COLORSPACE_BT878 = 4,
/* These should be useful. Assume 601 extents. */
V4L2_COLORSPACE_470_SYSTEM_M = 5,
V4L2_COLORSPACE_470_SYSTEM_BG = 6,
/* I know there will be cameras that send this. So, this is
* unspecified chromaticities and full 0-255 on each of the
* Y'CbCr components
*/
V4L2_COLORSPACE_JPEG = 7,
/* For RGB colourspaces, this is probably a good start. */
V4L2_COLORSPACE_SRGB = 8,
};
enum v4l2_priority {
V4L2_PRIORITY_UNSET = 0, /* not initialized */
V4L2_PRIORITY_BACKGROUND = 1,
V4L2_PRIORITY_INTERACTIVE = 2,
V4L2_PRIORITY_RECORD = 3,
V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
};
struct v4l2_rect {
__s32 left;
__s32 top;
__s32 width;
__s32 height;
};
struct v4l2_fract {
__u32 numerator;
__u32 denominator;
};
/**
* struct v4l2_capability - Describes V4L2 device caps returned by VIDIOC_QUERYCAP
*
* @driver: name of the driver module (e.g. "bttv")
* @card: name of the card (e.g. "Hauppauge WinTV")
* @bus_info: name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
* @version: KERNEL_VERSION
* @capabilities: capabilities of the physical device as a whole
* @device_caps: capabilities accessed via this particular device (node)
* @reserved: reserved fields for future extensions
*/
struct v4l2_capability {
__u8 driver[16];
__u8 card[32];
__u8 bus_info[32];
__u32 version;
__u32 capabilities;
__u32 device_caps;
__u32 reserved[3];
};
/* Values for 'capabilities' field */
#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */
/* Is a video capture device that supports multiplanar formats */
#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
/* Is a video output device that supports multiplanar formats */
#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
#define V4L2_CAP_MODULATOR 0x00080000 /* has a modulator */
#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
#define V4L2_CAP_DEVICE_CAPS 0x80000000 /* sets device capabilities field */
/*
* V I D E O I M A G E F O R M A T
*/
struct v4l2_pix_format {
__u32 width;
__u32 height;
__u32 pixelformat;
enum v4l2_field field;
__u32 bytesperline; /* for padding, zero if unused */
__u32 sizeimage;
enum v4l2_colorspace colorspace;
__u32 priv; /* private data, depends on pixelformat */
};
/* Pixel format FOURCC depth Description */
/* RGB formats */
#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
#define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
/* Grey formats */
#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
/* Grey bit-packed formats */
#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
/* Palette formats */
#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
/* Luminance+Chrominance formats */
#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */
#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
#define V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
#define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
#define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
#define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
/* two planes -- one Y, one Cr + Cb interleaved */
#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
#define V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
#define V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
/* two non contiguous planes - one Y, one Cr + Cb interleaved */
#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
/* three non contiguous planes - Y, Cb, Cr */
#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
#define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
#define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */
#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
/* 10bit raw bayer DPCM compressed to 8 bits */
#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
/*
* 10bit raw bayer, expanded to 16 bits
* xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
*/
#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
/* compressed formats */
#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */
#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
#define V4L2_PIX_FMT_DIVX_311 v4l2_fourcc('D', 'I', 'V', '3') /* DIVX311 */
#define V4L2_PIX_FMT_DIVX v4l2_fourcc('D', 'I', 'V', 'X') /* DIVX */
#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* ON2 VP8 stream */
/* Vendor-specific formats */
#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
#define V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
#define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
#define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
/*
* F O R M A T E N U M E R A T I O N
*/
struct v4l2_fmtdesc {
__u32 index; /* Format number */
enum v4l2_buf_type type; /* buffer type */
__u32 flags;
__u8 description[32]; /* Description string */
__u32 pixelformat; /* Format fourcc */
__u32 reserved[4];
};
#define V4L2_FMT_FLAG_COMPRESSED 0x0001
#define V4L2_FMT_FLAG_EMULATED 0x0002
#if 1
/* Experimental Frame Size and frame rate enumeration */
/*
* F R A M E S I Z E E N U M E R A T I O N
*/
enum v4l2_frmsizetypes {
V4L2_FRMSIZE_TYPE_DISCRETE = 1,
V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
V4L2_FRMSIZE_TYPE_STEPWISE = 3,
};
struct v4l2_frmsize_discrete {
__u32 width; /* Frame width [pixel] */
__u32 height; /* Frame height [pixel] */
};
struct v4l2_frmsize_stepwise {
__u32 min_width; /* Minimum frame width [pixel] */
__u32 max_width; /* Maximum frame width [pixel] */
__u32 step_width; /* Frame width step size [pixel] */
__u32 min_height; /* Minimum frame height [pixel] */
__u32 max_height; /* Maximum frame height [pixel] */
__u32 step_height; /* Frame height step size [pixel] */
};
struct v4l2_frmsizeenum {
__u32 index; /* Frame size number */
__u32 pixel_format; /* Pixel format */
__u32 type; /* Frame size type the device supports. */
union { /* Frame size */
struct v4l2_frmsize_discrete discrete;
struct v4l2_frmsize_stepwise stepwise;
};
__u32 reserved[2]; /* Reserved space for future use */
};
/*
* F R A M E R A T E E N U M E R A T I O N
*/
enum v4l2_frmivaltypes {
V4L2_FRMIVAL_TYPE_DISCRETE = 1,
V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
V4L2_FRMIVAL_TYPE_STEPWISE = 3,
};
struct v4l2_frmival_stepwise {
struct v4l2_fract min; /* Minimum frame interval [s] */
struct v4l2_fract max; /* Maximum frame interval [s] */
struct v4l2_fract step; /* Frame interval step size [s] */
};
struct v4l2_frmivalenum {
__u32 index; /* Frame format index */
__u32 pixel_format; /* Pixel format */
__u32 width; /* Frame width */
__u32 height; /* Frame height */
__u32 type; /* Frame interval type the device supports. */
union { /* Frame interval */
struct v4l2_fract discrete;
struct v4l2_frmival_stepwise stepwise;
};
__u32 reserved[2]; /* Reserved space for future use */
};
#endif
/*
* T I M E C O D E
*/
struct v4l2_timecode {
__u32 type;
__u32 flags;
__u8 frames;
__u8 seconds;
__u8 minutes;
__u8 hours;
__u8 userbits[4];
};
/* Type */
#define V4L2_TC_TYPE_24FPS 1
#define V4L2_TC_TYPE_25FPS 2
#define V4L2_TC_TYPE_30FPS 3
#define V4L2_TC_TYPE_50FPS 4
#define V4L2_TC_TYPE_60FPS 5
/* Flags */
#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */
#define V4L2_TC_FLAG_COLORFRAME 0x0002
#define V4L2_TC_USERBITS_field 0x000C
#define V4L2_TC_USERBITS_USERDEFINED 0x0000
#define V4L2_TC_USERBITS_8BITCHARS 0x0008
/* The above is based on SMPTE timecodes */
struct v4l2_jpegcompression {
int quality;
int APPn; /* Number of APP segment to be written,
* must be 0..15 */
int APP_len; /* Length of data in JPEG APPn segment */
char APP_data[60]; /* Data in the JPEG APPn segment. */
int COM_len; /* Length of data in JPEG COM segment */
char COM_data[60]; /* Data in JPEG COM segment */
__u32 jpeg_markers; /* Which markers should go into the JPEG
* output. Unless you exactly know what
* you do, leave them untouched.
* Inluding less markers will make the
* resulting code smaller, but there will
* be fewer applications which can read it.
* The presence of the APP and COM marker
* is influenced by APP_len and COM_len
* ONLY, not by this property! */
#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */
#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */
#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
* allways use APP0 */
};
/*
* M E M O R Y - M A P P I N G B U F F E R S
*/
struct v4l2_requestbuffers {
__u32 count;
enum v4l2_buf_type type;
enum v4l2_memory memory;
__u32 reserved[2];
};
/**
* struct v4l2_plane - plane info for multi-planar buffers
* @bytesused: number of bytes occupied by data in the plane (payload)
* @length: size of this plane (NOT the payload) in bytes
* @mem_offset: when memory in the associated struct v4l2_buffer is
* V4L2_MEMORY_MMAP, equals the offset from the start of
* the device memory for this plane (or is a "cookie" that
* should be passed to mmap() called on the video node)
* @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
* pointing to this plane
* @data_offset: offset in the plane to the start of data; usually 0,
* unless there is a header in front of the data
*
* Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
* with two planes can have one plane for Y, and another for interleaved CbCr
* components. Each plane can reside in a separate memory buffer, or even in
* a completely separate memory node (e.g. in embedded devices).
*/
struct v4l2_plane {
__u32 bytesused;
__u32 length;
union {
__u32 mem_offset;
unsigned long userptr;
} m;
__u32 data_offset;
__u32 reserved[11];
};
/**
* struct v4l2_buffer - video buffer info
* @index: id number of the buffer
* @type: buffer type (type == *_MPLANE for multiplanar buffers)
* @bytesused: number of bytes occupied by data in the buffer (payload);
* unused (set to 0) for multiplanar buffers
* @flags: buffer informational flags
* @field: field order of the image in the buffer
* @timestamp: frame timestamp
* @timecode: frame timecode
* @sequence: sequence count of this frame
* @memory: the method, in which the actual video data is passed
* @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
* offset from the start of the device memory for this plane,
* (or a "cookie" that should be passed to mmap() as offset)
* @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
* a userspace pointer pointing to this buffer
* @planes: for multiplanar buffers; userspace pointer to the array of plane
* info structs for this buffer
* @length: size in bytes of the buffer (NOT its payload) for single-plane
* buffers (when type != *_MPLANE); number of elements in the
* planes array for multi-plane buffers
* @input: input number from which the video data has has been captured
*
* Contains data exchanged by application and driver using one of the Streaming
* I/O methods.
*/
struct v4l2_buffer {
__u32 index;
enum v4l2_buf_type type;
__u32 bytesused;
__u32 flags;
enum v4l2_field field;
struct timeval timestamp;
struct v4l2_timecode timecode;
__u32 sequence;
/* memory location */
enum v4l2_memory memory;
union {
__u32 offset;
unsigned long userptr;
struct v4l2_plane *planes;
} m;
__u32 length;
__u32 input;
__u32 reserved;
};
/* Flags for 'flags' field */
#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */
#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */
#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */
#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
/* Buffer is ready, but the data contained within is corrupted. */
#define V4L2_BUF_FLAG_ERROR 0x0040
#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
/* Cache handling flags */
#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
#define V4L2_BUF_FLAG_EOS 0x2000
/*
* O V E R L A Y P R E V I E W
*/
struct v4l2_framebuffer {
__u32 capability;
__u32 flags;
/* FIXME: in theory we should pass something like PCI device + memory
* region + offset instead of some physical address */
void *base;
struct v4l2_pix_format fmt;
};
/* Flags for the 'capability' field. Read only */
#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010
#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020
#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040
#define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080
/* Flags for the 'flags' field. */
#define V4L2_FBUF_FLAG_PRIMARY 0x0001
#define V4L2_FBUF_FLAG_OVERLAY 0x0002
#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008
#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010
#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020
#define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040
struct v4l2_clip {
struct v4l2_rect c;
struct v4l2_clip __user *next;
};
struct v4l2_window {
struct v4l2_rect w;
enum v4l2_field field;
__u32 chromakey;
struct v4l2_clip __user *clips;
__u32 clipcount;
void __user *bitmap;
__u8 global_alpha;
};
/*
* C A P T U R E P A R A M E T E R S
*/
struct v4l2_captureparm {
__u32 capability; /* Supported modes */
__u32 capturemode; /* Current mode */
struct v4l2_fract timeperframe; /* Time per frame in .1us units */
__u32 extendedmode; /* Driver-specific extensions */
__u32 readbuffers; /* # of buffers for read */
__u32 reserved[4];
};
/* Flags for 'capability' and 'capturemode' fields */
#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */
#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */
#define V4L2_CAP_QCOM_FRAMESKIP 0x2000 /* frame skipping is supported */
struct v4l2_qcom_frameskip {
__u64 maxframeinterval;
};
struct v4l2_outputparm {
__u32 capability; /* Supported modes */
__u32 outputmode; /* Current mode */
struct v4l2_fract timeperframe; /* Time per frame in seconds */
__u32 extendedmode; /* Driver-specific extensions */
__u32 writebuffers; /* # of buffers for write */
__u32 reserved[4];
};
/*
* I N P U T I M A G E C R O P P I N G
*/
struct v4l2_cropcap {
enum v4l2_buf_type type;
struct v4l2_rect bounds;
struct v4l2_rect defrect;
struct v4l2_fract pixelaspect;
};
struct v4l2_crop {
enum v4l2_buf_type type;
struct v4l2_rect c;
};
/* Hints for adjustments of selection rectangle */
#define V4L2_SEL_FLAG_GE 0x00000001
#define V4L2_SEL_FLAG_LE 0x00000002
/* Selection targets */
/* Current cropping area */
#define V4L2_SEL_TGT_CROP_ACTIVE 0x0000
/* Default cropping area */
#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
/* Cropping bounds */
#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
/* Current composing area */
#define V4L2_SEL_TGT_COMPOSE_ACTIVE 0x0100
/* Default composing area */
#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
/* Composing bounds */
#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
/* Current composing area plus all padding pixels */
#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
/**
* struct v4l2_selection - selection info
* @type: buffer type (do not use *_MPLANE types)
* @target: selection target, used to choose one of possible rectangles
* @flags: constraints flags
* @r: coordinates of selection window
* @reserved: for future use, rounds structure size to 64 bytes, set to zero
*
* Hardware may use multiple helper windows to process a video stream.
* The structure is used to exchange this selection areas between
* an application and a driver.
*/
struct v4l2_selection {
__u32 type;
__u32 target;
__u32 flags;
struct v4l2_rect r;
__u32 reserved[9];
};
/*
* A N A L O G V I D E O S T A N D A R D
*/
typedef __u64 v4l2_std_id;
/* one bit for each */
#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) /* BTSC */
#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) /* EIA-J */
#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) /* FM A2 */
#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
/* ATSC/HDTV */
#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
/* FIXME:
Although std_id is 64 bits, there is an issue on PPC32 architecture that
makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
this value to 32 bits.
As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
it should work fine. However, if needed to add more than two standards,
v4l2-common.c should be fixed.
*/
/*
* Some macros to merge video standards in order to make live easier for the
* drivers and V4L2 applications
*/
/*
* "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
* Missing here.
*/
#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
V4L2_STD_NTSC_M_JP |\
V4L2_STD_NTSC_M_KR)
/* Secam macros */
#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
V4L2_STD_SECAM_K |\
V4L2_STD_SECAM_K1)
/* All Secam Standards */
#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
V4L2_STD_SECAM_G |\
V4L2_STD_SECAM_H |\
V4L2_STD_SECAM_DK |\
V4L2_STD_SECAM_L |\
V4L2_STD_SECAM_LC)
/* PAL macros */
#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
V4L2_STD_PAL_B1 |\
V4L2_STD_PAL_G)
#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
V4L2_STD_PAL_D1 |\
V4L2_STD_PAL_K)
/*
* "Common" PAL - This macro is there to be compatible with the old
* V4L1 concept of "PAL": /BGDKHI.
* Several PAL standards are mising here: /M, /N and /Nc
*/
#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
V4L2_STD_PAL_DK |\
V4L2_STD_PAL_H |\
V4L2_STD_PAL_I)
/* Chroma "agnostic" standards */
#define V4L2_STD_B (V4L2_STD_PAL_B |\
V4L2_STD_PAL_B1 |\
V4L2_STD_SECAM_B)
#define V4L2_STD_G (V4L2_STD_PAL_G |\
V4L2_STD_SECAM_G)
#define V4L2_STD_H (V4L2_STD_PAL_H |\
V4L2_STD_SECAM_H)
#define V4L2_STD_L (V4L2_STD_SECAM_L |\
V4L2_STD_SECAM_LC)
#define V4L2_STD_GH (V4L2_STD_G |\
V4L2_STD_H)
#define V4L2_STD_DK (V4L2_STD_PAL_DK |\
V4L2_STD_SECAM_DK)
#define V4L2_STD_BG (V4L2_STD_B |\
V4L2_STD_G)
#define V4L2_STD_MN (V4L2_STD_PAL_M |\
V4L2_STD_PAL_N |\
V4L2_STD_PAL_Nc |\
V4L2_STD_NTSC)
/* Standards where MTS/BTSC stereo could be found */
#define V4L2_STD_MTS (V4L2_STD_NTSC_M |\
V4L2_STD_PAL_M |\
V4L2_STD_PAL_N |\
V4L2_STD_PAL_Nc)
/* Standards for Countries with 60Hz Line frequency */
#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
V4L2_STD_PAL_60 |\
V4L2_STD_NTSC |\
V4L2_STD_NTSC_443)
/* Standards for Countries with 50Hz Line frequency */
#define V4L2_STD_625_50 (V4L2_STD_PAL |\
V4L2_STD_PAL_N |\
V4L2_STD_PAL_Nc |\
V4L2_STD_SECAM)
#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
V4L2_STD_ATSC_16_VSB)
/* Macros with none and all analog standards */
#define V4L2_STD_UNKNOWN 0
#define V4L2_STD_ALL (V4L2_STD_525_60 |\
V4L2_STD_625_50)
struct v4l2_standard {
__u32 index;
v4l2_std_id id;
__u8 name[24];
struct v4l2_fract frameperiod; /* Frames, not fields */
__u32 framelines;
__u32 reserved[4];
};
/*
* V I D E O T I M I N G S D V P R E S E T
*/
struct v4l2_dv_preset {
__u32 preset;
__u32 reserved[4];
};
/*
* D V P R E S E T S E N U M E R A T I O N
*/
struct v4l2_dv_enum_preset {
__u32 index;
__u32 preset;
__u8 name[32]; /* Name of the preset timing */
__u32 width;
__u32 height;
__u32 reserved[4];
};
/*
* D V P R E S E T V A L U E S
*/
#define V4L2_DV_INVALID 0
#define V4L2_DV_480P59_94 1 /* BT.1362 */
#define V4L2_DV_576P50 2 /* BT.1362 */
#define V4L2_DV_720P24 3 /* SMPTE 296M */
#define V4L2_DV_720P25 4 /* SMPTE 296M */
#define V4L2_DV_720P30 5 /* SMPTE 296M */
#define V4L2_DV_720P50 6 /* SMPTE 296M */
#define V4L2_DV_720P59_94 7 /* SMPTE 274M */
#define V4L2_DV_720P60 8 /* SMPTE 274M/296M */
#define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */
#define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */
#define V4L2_DV_1080I25 11 /* BT.1120 */
#define V4L2_DV_1080I50 12 /* SMPTE 296M */
#define V4L2_DV_1080I60 13 /* SMPTE 296M */
#define V4L2_DV_1080P24 14 /* SMPTE 296M */
#define V4L2_DV_1080P25 15 /* SMPTE 296M */
#define V4L2_DV_1080P30 16 /* SMPTE 296M */
#define V4L2_DV_1080P50 17 /* BT.1120 */
#define V4L2_DV_1080P60 18 /* BT.1120 */
/*
* D V B T T I M I N G S
*/
/* BT.656/BT.1120 timing data */
struct v4l2_bt_timings {
__u32 width; /* width in pixels */
__u32 height; /* height in lines */
__u32 interlaced; /* Interlaced or progressive */
__u32 polarities; /* Positive or negative polarity */
__u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz->74250000 */
__u32 hfrontporch; /* Horizpontal front porch in pixels */
__u32 hsync; /* Horizontal Sync length in pixels */
__u32 hbackporch; /* Horizontal back porch in pixels */
__u32 vfrontporch; /* Vertical front porch in pixels */
__u32 vsync; /* Vertical Sync length in lines */
__u32 vbackporch; /* Vertical back porch in lines */
__u32 il_vfrontporch; /* Vertical front porch for bottom field of
* interlaced field formats
*/
__u32 il_vsync; /* Vertical sync length for bottom field of
* interlaced field formats
*/
__u32 il_vbackporch; /* Vertical back porch for bottom field of
* interlaced field formats
*/
__u32 reserved[16];
} __attribute__ ((packed));
/* Interlaced or progressive format */
#define V4L2_DV_PROGRESSIVE 0
#define V4L2_DV_INTERLACED 1
/* Polarities. If bit is not set, it is assumed to be negative polarity */
#define V4L2_DV_VSYNC_POS_POL 0x00000001
#define V4L2_DV_HSYNC_POS_POL 0x00000002
/* DV timings */
struct v4l2_dv_timings {
__u32 type;
union {
struct v4l2_bt_timings bt;
__u32 reserved[32];
};
} __attribute__ ((packed));
/* Values for the type field */
#define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */
/*
* V I D E O I N P U T S
*/
struct v4l2_input {
__u32 index; /* Which input */
__u8 name[32]; /* Label */
__u32 type; /* Type of input */
__u32 audioset; /* Associated audios (bitfield) */
__u32 tuner; /* Associated tuner */
v4l2_std_id std;
__u32 status;
__u32 capabilities;
__u32 reserved[3];
};
/* Values for the 'type' field */
#define V4L2_INPUT_TYPE_TUNER 1
#define V4L2_INPUT_TYPE_CAMERA 2
/* field 'status' - general */
#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */
#define V4L2_IN_ST_NO_SIGNAL 0x00000002
#define V4L2_IN_ST_NO_COLOR 0x00000004
/* field 'status' - sensor orientation */
/* If sensor is mounted upside down set both bits */
#define V4L2_IN_ST_HFLIP 0x00000010 /* Frames are flipped horizontally */
#define V4L2_IN_ST_VFLIP 0x00000020 /* Frames are flipped vertically */
/* field 'status' - analog */
#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */
#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
/* field 'status' - digital */
#define V4L2_IN_ST_NO_SYNC 0x00010000 /* No synchronization lock */
#define V4L2_IN_ST_NO_EQU 0x00020000 /* No equalizer lock */
#define V4L2_IN_ST_NO_CARRIER 0x00040000 /* Carrier recovery failed */
/* field 'status' - VCR and set-top box */
#define V4L2_IN_ST_MACROVISION 0x01000000 /* Macrovision detected */
#define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */
#define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */
/* capabilities flags */
#define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
#define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
#define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */
/*
* V I D E O O U T P U T S
*/
struct v4l2_output {
__u32 index; /* Which output */
__u8 name[32]; /* Label */
__u32 type; /* Type of output */
__u32 audioset; /* Associated audios (bitfield) */
__u32 modulator; /* Associated modulator */
v4l2_std_id std;
__u32 capabilities;
__u32 reserved[3];
};
/* Values for the 'type' field */
#define V4L2_OUTPUT_TYPE_MODULATOR 1
#define V4L2_OUTPUT_TYPE_ANALOG 2
#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
/* capabilities flags */
#define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */
#define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */
#define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */
/*
* C O N T R O L S
*/
struct v4l2_control {
__u32 id;
__s32 value;
};
struct v4l2_ext_control {
__u32 id;
__u32 size;
__u32 reserved2[1];
union {
__s32 value;
__s64 value64;
char *string;
};
} __attribute__ ((packed));
struct v4l2_ext_controls {
__u32 ctrl_class;
__u32 count;
__u32 error_idx;
__u32 reserved[2];
struct v4l2_ext_control *controls;
};
/* Values for ctrl_class field */
#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
#define V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
#define V4L2_CTRL_ID_MASK (0x0fffffff)
#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
enum v4l2_ctrl_type {
V4L2_CTRL_TYPE_INTEGER = 1,
V4L2_CTRL_TYPE_BOOLEAN = 2,
V4L2_CTRL_TYPE_MENU = 3,
V4L2_CTRL_TYPE_BUTTON = 4,
V4L2_CTRL_TYPE_INTEGER64 = 5,
V4L2_CTRL_TYPE_CTRL_CLASS = 6,
V4L2_CTRL_TYPE_STRING = 7,
V4L2_CTRL_TYPE_BITMASK = 8,
};
/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
struct v4l2_queryctrl {
__u32 id;
enum v4l2_ctrl_type type;
__u8 name[32]; /* Whatever */
__s32 minimum; /* Note signedness */
__s32 maximum;
__s32 step;
__s32 default_value;
__u32 flags;
__u32 reserved[2];
};
/* Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
struct v4l2_querymenu {
__u32 id;
__u32 index;
__u8 name[32]; /* Whatever */
__u32 reserved;
};
/* Control flags */
#define V4L2_CTRL_FLAG_DISABLED 0x0001
#define V4L2_CTRL_FLAG_GRABBED 0x0002
#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
#define V4L2_CTRL_FLAG_UPDATE 0x0008
#define V4L2_CTRL_FLAG_INACTIVE 0x0010
#define V4L2_CTRL_FLAG_SLIDER 0x0020
#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
#define V4L2_CTRL_FLAG_VOLATILE 0x0080
/* Query flag, to be ORed with the control ID */
#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
/* User-class control IDs defined by V4L2 */
#define V4L2_CID_MAX_CTRLS 1024
#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
#define V4L2_CID_USER_BASE V4L2_CID_BASE
/* IDs reserved for driver specific controls */
#define V4L2_CID_PRIVATE_BASE 0x08000000
#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
#define V4L2_CID_HUE (V4L2_CID_BASE+3)
#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */
#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA) /* Deprecated */
#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
/* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
#define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
enum v4l2_power_line_frequency {
V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
};
#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
#define V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
#define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
#define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
#define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
#define V4L2_CID_COLORFX (V4L2_CID_BASE+31)
enum v4l2_colorfx {
V4L2_COLORFX_NONE = 0,
V4L2_COLORFX_BW = 1,
V4L2_COLORFX_SEPIA = 2,
V4L2_COLORFX_NEGATIVE = 3,
V4L2_COLORFX_EMBOSS = 4,
V4L2_COLORFX_SKETCH = 5,
V4L2_COLORFX_SKY_BLUE = 6,
V4L2_COLORFX_GRASS_GREEN = 7,
V4L2_COLORFX_SKIN_WHITEN = 8,
V4L2_COLORFX_VIVID = 9,
};
#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
#define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
/* last CID + 1 */
#define V4L2_CID_LASTP1 (V4L2_CID_BASE+42)
#define V4L2_CID_SPECIAL_EFFECT (V4L2_CID_BASE+43)
/* Minimum number of buffer neede by the device */
/* MPEG-class control IDs defined by V4L2 */
#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
/* MPEG streams, specific to multiplexed streams */
#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
enum v4l2_mpeg_stream_type {
V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */
V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */
V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */
V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */
V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
};
#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
enum v4l2_mpeg_stream_vbi_fmt {
V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */
V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
};
/* MPEG audio controls specific to multiplexed streams */
#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
enum v4l2_mpeg_audio_sampling_freq {
V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
};
#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
enum v4l2_mpeg_audio_encoding {
V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
V4L2_MPEG_AUDIO_ENCODING_AAC = 3,
V4L2_MPEG_AUDIO_ENCODING_AC3 = 4,
};
#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
enum v4l2_mpeg_audio_l1_bitrate {
V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
};
#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
enum v4l2_mpeg_audio_l2_bitrate {
V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
};
#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
enum v4l2_mpeg_audio_l3_bitrate {
V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
};
#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
enum v4l2_mpeg_audio_mode {
V4L2_MPEG_AUDIO_MODE_STEREO = 0,
V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
V4L2_MPEG_AUDIO_MODE_DUAL = 2,
V4L2_MPEG_AUDIO_MODE_MONO = 3,
};
#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
enum v4l2_mpeg_audio_mode_extension {
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
};
#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
enum v4l2_mpeg_audio_emphasis {
V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
};
#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
enum v4l2_mpeg_audio_crc {
V4L2_MPEG_AUDIO_CRC_NONE = 0,
V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
};
#define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
enum v4l2_mpeg_audio_ac3_bitrate {
V4L2_MPEG_AUDIO_AC3_BITRATE_32K = 0,
V4L2_MPEG_AUDIO_AC3_BITRATE_40K = 1,
V4L2_MPEG_AUDIO_AC3_BITRATE_48K = 2,
V4L2_MPEG_AUDIO_AC3_BITRATE_56K = 3,
V4L2_MPEG_AUDIO_AC3_BITRATE_64K = 4,
V4L2_MPEG_AUDIO_AC3_BITRATE_80K = 5,
V4L2_MPEG_AUDIO_AC3_BITRATE_96K = 6,
V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
};
#define V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
enum v4l2_mpeg_audio_dec_playback {
V4L2_MPEG_AUDIO_DEC_PLAYBACK_AUTO = 0,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_STEREO = 1,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_LEFT = 2,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_RIGHT = 3,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_MONO = 4,
V4L2_MPEG_AUDIO_DEC_PLAYBACK_SWAPPED_STEREO = 5,
};
#define V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)
/* MPEG video controls specific to multiplexed streams */
#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
enum v4l2_mpeg_video_encoding {
V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
};
#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
enum v4l2_mpeg_video_aspect {
V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
};
#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
enum v4l2_mpeg_video_bitrate_mode {
V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
};
#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
enum v4l2_mpeg_video_header_mode {
V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_I_FRAME = 2,
};
#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
enum v4l2_mpeg_video_multi_slice_mode {
V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
};
#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
#define V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
#define V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
enum v4l2_mpeg_video_h264_entropy_mode {
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
};
#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
enum v4l2_mpeg_video_h264_level {
V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
};
#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
enum v4l2_mpeg_video_h264_loop_filter_mode {
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
};
#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
enum v4l2_mpeg_video_h264_profile {
V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
};
#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
enum v4l2_mpeg_video_h264_vui_sar_idc {
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
};
#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
enum v4l2_mpeg_video_mpeg4_level {
V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
};
#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
enum v4l2_mpeg_video_mpeg4_profile {
V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
};
#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
enum v4l2_mpeg_cx2341x_video_median_filter_type {
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
};
#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
#define V4L2_CID_MPEG_QCOM_BASE (V4L2_CTRL_CLASS_MPEG | 0x2100)
#define V4L2_CID_MPEG_QCOM_SET_PERF_LEVEL (V4L2_CID_MPEG_QCOM_BASE + 0)
enum v3l2_mpeg_qcom_perf_level {
V4L2_CID_MPEG_QCOM_PERF_LEVEL_PERFORMANCE = 0,
V4L2_CID_MPEG_QCOM_PERF_LEVEL_TURBO = 1,
};
#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
enum v4l2_mpeg_mfc51_video_frame_skip_mode {
V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
};
#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
enum v4l2_mpeg_mfc51_video_force_frame_type {
V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
};
#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
/* MPEG-class control IDs specific to the msm_vidc driver */
#define V4L2_CID_MPEG_MSM_VIDC_BASE (V4L2_CTRL_CLASS_MPEG | 0x2000)
#define V4L2_CID_MPEG_VIDC_VIDEO_ENABLE_PICTURE_TYPE \
(V4L2_CID_MPEG_MSM_VIDC_BASE+0)
#define V4L2_CID_MPEG_VIDC_VIDEO_KEEP_ASPECT_RATIO \
(V4L2_CID_MPEG_MSM_VIDC_BASE+1)
#define V4L2_CID_MPEG_VIDC_VIDEO_POST_LOOP_DEBLOCKER_MODE \
(V4L2_CID_MPEG_MSM_VIDC_BASE+2)
#define V4L2_CID_MPEG_VIDC_VIDEO_DIVX_FORMAT \
(V4L2_CID_MPEG_MSM_VIDC_BASE+3)
enum v4l2_mpeg_vidc_video_divx_format_type {
V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_4 = 0,
V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_5 = 1,
V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_6 = 2,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_MB_ERROR_MAP_REPORTING \
(V4L2_CID_MPEG_MSM_VIDC_BASE+4)
#define V4L2_CID_MPEG_VIDC_VIDEO_CONTINUE_DATA_TRANSFER \
(V4L2_CID_MPEG_MSM_VIDC_BASE+5)
#define V4L2_CID_MPEG_VIDC_VIDEO_STREAM_FORMAT (V4L2_CID_MPEG_MSM_VIDC_BASE+6)
enum v4l2_mpeg_vidc_video_stream_format {
V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_STARTCODES = 0,
V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_ONE_NAL_PER_BUFFER = 1,
V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_ONE_BYTE_LENGTH = 2,
V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_TWO_BYTE_LENGTH = 3,
V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_FOUR_BYTE_LENGTH = 4,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_OUTPUT_ORDER (V4L2_CID_MPEG_MSM_VIDC_BASE+7)
enum v4l2_mpeg_vidc_video_output_order {
V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DISPLAY = 0,
V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DECODE = 1,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_FRAME_RATE (V4L2_CID_MPEG_MSM_VIDC_BASE+8)
#define V4L2_CID_MPEG_VIDC_VIDEO_IDR_PERIOD (V4L2_CID_MPEG_MSM_VIDC_BASE+9)
#define V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES (V4L2_CID_MPEG_MSM_VIDC_BASE+10)
#define V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES (V4L2_CID_MPEG_MSM_VIDC_BASE+11)
#define V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_IFRAME (V4L2_CID_MPEG_MSM_VIDC_BASE+12)
#define V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL (V4L2_CID_MPEG_MSM_VIDC_BASE+13)
enum v4l2_mpeg_vidc_video_rate_control {
V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_OFF = 0,
V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_VFR = 1,
V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_CFR = 2,
V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_VFR = 3,
V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_CFR = 4,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_ROTATION (V4L2_CID_MPEG_MSM_VIDC_BASE+14)
enum v4l2_mpeg_vidc_video_rotation {
V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_NONE = 0,
V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 = 1,
V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_180 = 2,
V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270 = 3,
};
#define MSM_VIDC_BASE V4L2_CID_MPEG_MSM_VIDC_BASE
#define V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL (MSM_VIDC_BASE+15)
enum v4l2_mpeg_vidc_h264_cabac_model {
V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_0 = 0,
V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_1 = 1,
V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_2 = 2,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_MODE (MSM_VIDC_BASE+16)
enum v4l2_mpeg_vidc_video_intra_refresh_mode {
V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_NONE = 0,
V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_CYCLIC = 1,
V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_ADAPTIVE = 2,
V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_CYCLIC_ADAPTIVE = 3,
V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_RANDOM = 4,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_AIR_MBS (V4L2_CID_MPEG_MSM_VIDC_BASE+17)
#define V4L2_CID_MPEG_VIDC_VIDEO_AIR_REF (V4L2_CID_MPEG_MSM_VIDC_BASE+18)
#define V4L2_CID_MPEG_VIDC_VIDEO_CIR_MBS (V4L2_CID_MPEG_MSM_VIDC_BASE+19)
/* Camera class control IDs */
#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
#define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
enum v4l2_exposure_auto_type {
V4L2_EXPOSURE_AUTO = 0,
V4L2_EXPOSURE_MANUAL = 1,
V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
V4L2_EXPOSURE_APERTURE_PRIORITY = 3
};
#define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
#define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
#define V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
#define V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
#define V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
#define V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
#define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
#define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
#define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
#define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
#define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
/* FM Modulator class control IDs */
#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
#define V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
#define V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
#define V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
#define V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
#define V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
#define V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
#define V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
#define V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
#define V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
enum v4l2_preemphasis {
V4L2_PREEMPHASIS_DISABLED = 0,
V4L2_PREEMPHASIS_50_uS = 1,
V4L2_PREEMPHASIS_75_uS = 2,
};
#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
/* Flash and privacy (indicator) light controls */
#define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
#define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
#define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
enum v4l2_flash_led_mode {
V4L2_FLASH_LED_MODE_NONE,
V4L2_FLASH_LED_MODE_FLASH,
V4L2_FLASH_LED_MODE_TORCH,
};
#define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
enum v4l2_flash_strobe_source {
V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
};
#define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
#define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
#define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
#define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
#define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
#define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
#define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
#define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
#define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
#define V4L2_FLASH_FAULT_OVER_CURRENT (1 << 4)
#define V4L2_FLASH_FAULT_INDICATOR (1 << 5)
#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
/* JPEG-class control IDs defined by V4L2 */
#define V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
#define V4L2_CID_JPEG_CLASS (V4L2_CTRL_CLASS_JPEG | 1)
#define V4L2_CID_JPEG_CHROMA_SUBSAMPLING (V4L2_CID_JPEG_CLASS_BASE + 1)
enum v4l2_jpeg_chroma_subsampling {
V4L2_JPEG_CHROMA_SUBSAMPLING_444 = 0,
V4L2_JPEG_CHROMA_SUBSAMPLING_422 = 1,
V4L2_JPEG_CHROMA_SUBSAMPLING_420 = 2,
V4L2_JPEG_CHROMA_SUBSAMPLING_411 = 3,
V4L2_JPEG_CHROMA_SUBSAMPLING_410 = 4,
V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY = 5,
};
#define V4L2_CID_JPEG_RESTART_INTERVAL (V4L2_CID_JPEG_CLASS_BASE + 2)
#define V4L2_CID_JPEG_COMPRESSION_QUALITY (V4L2_CID_JPEG_CLASS_BASE + 3)
#define V4L2_CID_JPEG_ACTIVE_MARKER (V4L2_CID_JPEG_CLASS_BASE + 4)
#define V4L2_JPEG_ACTIVE_MARKER_APP0 (1 << 0)
#define V4L2_JPEG_ACTIVE_MARKER_APP1 (1 << 1)
#define V4L2_JPEG_ACTIVE_MARKER_COM (1 << 16)
#define V4L2_JPEG_ACTIVE_MARKER_DQT (1 << 17)
#define V4L2_JPEG_ACTIVE_MARKER_DHT (1 << 18)
/*
* T U N I N G
*/
struct v4l2_tuner {
__u32 index;
__u8 name[32];
enum v4l2_tuner_type type;
__u32 capability;
__u32 rangelow;
__u32 rangehigh;
__u32 rxsubchans;
__u32 audmode;
__s32 signal;
__s32 afc;
__u32 reserved[4];
};
struct v4l2_modulator {
__u32 index;
__u8 name[32];
__u32 capability;
__u32 rangelow;
__u32 rangehigh;
__u32 txsubchans;
__u32 reserved[4];
};
/* Flags for the 'capability' field */
#define V4L2_TUNER_CAP_LOW 0x0001
#define V4L2_TUNER_CAP_NORM 0x0002
#define V4L2_TUNER_CAP_STEREO 0x0010
#define V4L2_TUNER_CAP_LANG2 0x0020
#define V4L2_TUNER_CAP_SAP 0x0020
#define V4L2_TUNER_CAP_LANG1 0x0040
#define V4L2_TUNER_CAP_RDS 0x0080
#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
/* Flags for the 'rxsubchans' field */
#define V4L2_TUNER_SUB_MONO 0x0001
#define V4L2_TUNER_SUB_STEREO 0x0002
#define V4L2_TUNER_SUB_LANG2 0x0004
#define V4L2_TUNER_SUB_SAP 0x0004
#define V4L2_TUNER_SUB_LANG1 0x0008
#define V4L2_TUNER_SUB_RDS 0x0010
/* Values for the 'audmode' field */
#define V4L2_TUNER_MODE_MONO 0x0000
#define V4L2_TUNER_MODE_STEREO 0x0001
#define V4L2_TUNER_MODE_LANG2 0x0002
#define V4L2_TUNER_MODE_SAP 0x0002
#define V4L2_TUNER_MODE_LANG1 0x0003
#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
struct v4l2_frequency {
__u32 tuner;
enum v4l2_tuner_type type;
__u32 frequency;
__u32 reserved[8];
};
struct v4l2_hw_freq_seek {
__u32 tuner;
enum v4l2_tuner_type type;
__u32 seek_upward;
__u32 wrap_around;
__u32 spacing;
__u32 reserved[7];
};
/*
* R D S
*/
struct v4l2_rds_data {
__u8 lsb;
__u8 msb;
__u8 block;
} __attribute__ ((packed));
#define V4L2_RDS_BLOCK_MSK 0x7
#define V4L2_RDS_BLOCK_A 0
#define V4L2_RDS_BLOCK_B 1
#define V4L2_RDS_BLOCK_C 2
#define V4L2_RDS_BLOCK_D 3
#define V4L2_RDS_BLOCK_C_ALT 4
#define V4L2_RDS_BLOCK_INVALID 7
#define V4L2_RDS_BLOCK_CORRECTED 0x40
#define V4L2_RDS_BLOCK_ERROR 0x80
/*
* A U D I O
*/
struct v4l2_audio {
__u32 index;
__u8 name[32];
__u32 capability;
__u32 mode;
__u32 reserved[2];
};
/* Flags for the 'capability' field */
#define V4L2_AUDCAP_STEREO 0x00001
#define V4L2_AUDCAP_AVL 0x00002
/* Flags for the 'mode' field */
#define V4L2_AUDMODE_AVL 0x00001
struct v4l2_audioout {
__u32 index;
__u8 name[32];
__u32 capability;
__u32 mode;
__u32 reserved[2];
};
/*
* M P E G S E R V I C E S
*
* NOTE: EXPERIMENTAL API
*/
#if 1
#define V4L2_ENC_IDX_FRAME_I (0)
#define V4L2_ENC_IDX_FRAME_P (1)
#define V4L2_ENC_IDX_FRAME_B (2)
#define V4L2_ENC_IDX_FRAME_MASK (0xf)
struct v4l2_enc_idx_entry {
__u64 offset;
__u64 pts;
__u32 length;
__u32 flags;
__u32 reserved[2];
};
#define V4L2_ENC_IDX_ENTRIES (64)
struct v4l2_enc_idx {
__u32 entries;
__u32 entries_cap;
__u32 reserved[4];
struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
};
#define V4L2_ENC_CMD_START (0)
#define V4L2_ENC_CMD_STOP (1)
#define V4L2_ENC_CMD_PAUSE (2)
#define V4L2_ENC_CMD_RESUME (3)
/* Flags for V4L2_ENC_CMD_STOP */
#define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0)
struct v4l2_encoder_cmd {
__u32 cmd;
__u32 flags;
union {
struct {
__u32 data[8];
} raw;
};
};
/* Decoder commands */
#define V4L2_DEC_CMD_START (0)
#define V4L2_DEC_CMD_STOP (1)
#define V4L2_DEC_CMD_PAUSE (2)
#define V4L2_DEC_CMD_RESUME (3)
/* Flags for V4L2_DEC_CMD_START */
#define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)
/* Flags for V4L2_DEC_CMD_PAUSE */
#define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0)
/* Flags for V4L2_DEC_CMD_STOP */
#define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0)
#define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1)
/* Play format requirements (returned by the driver): */
/* The decoder has no special format requirements */
#define V4L2_DEC_START_FMT_NONE (0)
/* The decoder requires full GOPs */
#define V4L2_DEC_START_FMT_GOP (1)
/* The structure must be zeroed before use by the application
This ensures it can be extended safely in the future. */
struct v4l2_decoder_cmd {
__u32 cmd;
__u32 flags;
union {
struct {
__u64 pts;
} stop;
struct {
/* 0 or 1000 specifies normal speed,
1 specifies forward single stepping,
-1 specifies backward single stepping,
>1: playback at speed/1000 of the normal speed,
<-1: reverse playback at (-speed/1000) of the normal speed. */
__s32 speed;
__u32 format;
} start;
struct {
__u32 data[16];
} raw;
};
};
#endif
/*
* D A T A S E R V I C E S ( V B I )
*
* Data services API by Michael Schimek
*/
/* Raw VBI */
struct v4l2_vbi_format {
__u32 sampling_rate; /* in 1 Hz */
__u32 offset;
__u32 samples_per_line;
__u32 sample_format; /* V4L2_PIX_FMT_* */
__s32 start[2];
__u32 count[2];
__u32 flags; /* V4L2_VBI_* */
__u32 reserved[2]; /* must be zero */
};
/* VBI flags */
#define V4L2_VBI_UNSYNC (1 << 0)
#define V4L2_VBI_INTERLACED (1 << 1)
/* Sliced VBI
*
* This implements is a proposal V4L2 API to allow SLICED VBI
* required for some hardware encoders. It should change without
* notice in the definitive implementation.
*/
struct v4l2_sliced_vbi_format {
__u16 service_set;
/* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
(equals frame lines 313-336 for 625 line video
standards, 263-286 for 525 line standards) */
__u16 service_lines[2][24];
__u32 io_size;
__u32 reserved[2]; /* must be zero */
};
/* Teletext World System Teletext
(WST), defined on ITU-R BT.653-2 */
#define V4L2_SLICED_TELETEXT_B (0x0001)
/* Video Program System, defined on ETS 300 231*/
#define V4L2_SLICED_VPS (0x0400)
/* Closed Caption, defined on EIA-608 */
#define V4L2_SLICED_CAPTION_525 (0x1000)
/* Wide Screen System, defined on ITU-R BT1119.1 */
#define V4L2_SLICED_WSS_625 (0x4000)
#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
struct v4l2_sliced_vbi_cap {
__u16 service_set;
/* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
(equals frame lines 313-336 for 625 line video
standards, 263-286 for 525 line standards) */
__u16 service_lines[2][24];
enum v4l2_buf_type type;
__u32 reserved[3]; /* must be 0 */
};
struct v4l2_sliced_vbi_data {
__u32 id;
__u32 field; /* 0: first field, 1: second field */
__u32 line; /* 1-23 */
__u32 reserved; /* must be 0 */
__u8 data[48];
};
/*
* Sliced VBI data inserted into MPEG Streams
*/
/*
* V4L2_MPEG_STREAM_VBI_FMT_IVTV:
*
* Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
* MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
* data
*
* Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
* definitions are not included here. See the MPEG-2 specifications for details
* on these headers.
*/
/* Line type IDs */
#define V4L2_MPEG_VBI_IVTV_TELETEXT_B (1)
#define V4L2_MPEG_VBI_IVTV_CAPTION_525 (4)
#define V4L2_MPEG_VBI_IVTV_WSS_625 (5)
#define V4L2_MPEG_VBI_IVTV_VPS (7)
struct v4l2_mpeg_vbi_itv0_line {
__u8 id; /* One of V4L2_MPEG_VBI_IVTV_* above */
__u8 data[42]; /* Sliced VBI data for the line */
} __attribute__ ((packed));
struct v4l2_mpeg_vbi_itv0 {
__le32 linemask[2]; /* Bitmasks of VBI service lines present */
struct v4l2_mpeg_vbi_itv0_line line[35];
} __attribute__ ((packed));
struct v4l2_mpeg_vbi_ITV0 {
struct v4l2_mpeg_vbi_itv0_line line[36];
} __attribute__ ((packed));
#define V4L2_MPEG_VBI_IVTV_MAGIC0 "itv0"
#define V4L2_MPEG_VBI_IVTV_MAGIC1 "ITV0"
struct v4l2_mpeg_vbi_fmt_ivtv {
__u8 magic[4];
union {
struct v4l2_mpeg_vbi_itv0 itv0;
struct v4l2_mpeg_vbi_ITV0 ITV0;
};
} __attribute__ ((packed));
/*
* A G G R E G A T E S T R U C T U R E S
*/
/**
* struct v4l2_plane_pix_format - additional, per-plane format definition
* @sizeimage: maximum size in bytes required for data, for which
* this plane will be used
* @bytesperline: distance in bytes between the leftmost pixels in two
* adjacent lines
*/
struct v4l2_plane_pix_format {
__u32 sizeimage;
__u16 bytesperline;
__u16 reserved[7];
} __attribute__ ((packed));
/**
* struct v4l2_pix_format_mplane - multiplanar format definition
* @width: image width in pixels
* @height: image height in pixels
* @pixelformat: little endian four character code (fourcc)
* @field: field order (for interlaced video)
* @colorspace: supplemental to pixelformat
* @plane_fmt: per-plane information
* @num_planes: number of planes for this format
*/
struct v4l2_pix_format_mplane {
__u32 width;
__u32 height;
__u32 pixelformat;
enum v4l2_field field;
enum v4l2_colorspace colorspace;
struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
__u8 num_planes;
__u8 reserved[11];
} __attribute__ ((packed));
/**
* struct v4l2_format - stream data format
* @type: type of the data stream
* @pix: definition of an image format
* @pix_mp: definition of a multiplanar image format
* @win: definition of an overlaid image
* @vbi: raw VBI capture or output parameters
* @sliced: sliced VBI capture or output parameters
* @raw_data: placeholder for future extensions and custom formats
*/
struct v4l2_format {
enum v4l2_buf_type type;
union {
struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
__u8 raw_data[200]; /* user-defined */
} fmt;
};
/* Stream type-dependent parameters
*/
struct v4l2_streamparm {
enum v4l2_buf_type type;
union {
struct v4l2_captureparm capture;
struct v4l2_outputparm output;
__u8 raw_data[200]; /* user-defined */
} parm;
};
/*
* E V E N T S
*/
#define V4L2_EVENT_ALL 0
#define V4L2_EVENT_VSYNC 1
#define V4L2_EVENT_EOS 2
#define V4L2_EVENT_CTRL 3
#define V4L2_EVENT_FRAME_SYNC 4
#define V4L2_EVENT_PRIVATE_START 0x08000000
/* Payload for V4L2_EVENT_VSYNC */
struct v4l2_event_vsync {
/* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
__u8 field;
} __attribute__ ((packed));
/* Payload for V4L2_EVENT_CTRL */
#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
struct v4l2_event_ctrl {
__u32 changes;
__u32 type;
union {
__s32 value;
__s64 value64;
};
__u32 flags;
__s32 minimum;
__s32 maximum;
__s32 step;
__s32 default_value;
};
struct v4l2_event_frame_sync {
__u32 frame_sequence;
};
struct v4l2_event {
__u32 type;
union {
struct v4l2_event_vsync vsync;
struct v4l2_event_ctrl ctrl;
struct v4l2_event_frame_sync frame_sync;
__u8 data[64];
} u;
__u32 pending;
__u32 sequence;
struct timespec timestamp;
__u32 id;
__u32 reserved[8];
};
#define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
struct v4l2_event_subscription {
__u32 type;
__u32 id;
__u32 flags;
__u32 reserved[5];
};
/*
* A D V A N C E D D E B U G G I N G
*
* NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
* FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
*/
/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
#define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */
#define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */
#define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */
#define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */
struct v4l2_dbg_match {
__u32 type; /* Match type */
union { /* Match this chip, meaning determined by type */
__u32 addr;
char name[32];
};
} __attribute__ ((packed));
struct v4l2_dbg_register {
struct v4l2_dbg_match match;
__u32 size; /* register size in bytes */
__u64 reg;
__u64 val;
} __attribute__ ((packed));
/* VIDIOC_DBG_G_CHIP_IDENT */
struct v4l2_dbg_chip_ident {
struct v4l2_dbg_match match;
__u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */
__u32 revision; /* chip revision, chip specific */
} __attribute__ ((packed));
/**
* struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
* @index: on return, index of the first created buffer
* @count: entry: number of requested buffers,
* return: number of created buffers
* @memory: buffer memory type
* @format: frame format, for which buffers are requested
* @reserved: future extensions
*/
struct v4l2_create_buffers {
__u32 index;
__u32 count;
enum v4l2_memory memory;
struct v4l2_format format;
__u32 reserved[8];
};
/*
* I O C T L C O D E S F O R V I D E O D E V I C E S
*
*/
#define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability)
#define VIDIOC_RESERVED _IO('V', 1)
#define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
#define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format)
#define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format)
#define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
#define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer)
#define VIDIOC_G_FBUF _IOR('V', 10, struct v4l2_framebuffer)
#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
#define VIDIOC_OVERLAY _IOW('V', 14, int)
#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
#define VIDIOC_STREAMON _IOW('V', 18, int)
#define VIDIOC_STREAMOFF _IOW('V', 19, int)
#define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
#define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
#define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id)
#define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id)
#define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
#define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
#define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
#define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
#define VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
#define VIDIOC_S_TUNER _IOW('V', 30, struct v4l2_tuner)
#define VIDIOC_G_AUDIO _IOR('V', 33, struct v4l2_audio)
#define VIDIOC_S_AUDIO _IOW('V', 34, struct v4l2_audio)
#define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
#define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu)
#define VIDIOC_G_INPUT _IOR('V', 38, int)
#define VIDIOC_S_INPUT _IOWR('V', 39, int)
#define VIDIOC_G_OUTPUT _IOR('V', 46, int)
#define VIDIOC_S_OUTPUT _IOWR('V', 47, int)
#define VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct v4l2_output)
#define VIDIOC_G_AUDOUT _IOR('V', 49, struct v4l2_audioout)
#define VIDIOC_S_AUDOUT _IOW('V', 50, struct v4l2_audioout)
#define VIDIOC_G_MODULATOR _IOWR('V', 54, struct v4l2_modulator)
#define VIDIOC_S_MODULATOR _IOW('V', 55, struct v4l2_modulator)
#define VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency)
#define VIDIOC_S_FREQUENCY _IOW('V', 57, struct v4l2_frequency)
#define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
#define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
#define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop)
#define VIDIOC_G_JPEGCOMP _IOR('V', 61, struct v4l2_jpegcompression)
#define VIDIOC_S_JPEGCOMP _IOW('V', 62, struct v4l2_jpegcompression)
#define VIDIOC_QUERYSTD _IOR('V', 63, v4l2_std_id)
#define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format)
#define VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio)
#define VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout)
#define VIDIOC_G_PRIORITY _IOR('V', 67, enum v4l2_priority)
#define VIDIOC_S_PRIORITY _IOW('V', 68, enum v4l2_priority)
#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
#define VIDIOC_LOG_STATUS _IO('V', 70)
#define VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct v4l2_ext_controls)
#define VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct v4l2_ext_controls)
#define VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct v4l2_ext_controls)
#if 1
#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
#define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx)
#define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd)
#define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd)
#endif
#if 1
/* Experimental, meant for debugging, testing and internal use.
Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
You must be root to use these ioctls. Never use these in applications! */
#define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register)
#define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register)
/* Experimental, meant for debugging, testing and internal use.
Never use this ioctl in applications! */
#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
#endif
#define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek)
#define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset)
#define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset)
#define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset)
#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset)
#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
/* Experimental, the below two ioctls may change over the next couple of kernel
versions */
#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
/* Experimental selection API */
#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
#define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)
/* Experimental, these two ioctls may change over the next couple of kernel
versions. */
#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)
/* Reminder: when adding new ioctls please add support for them to
drivers/media/video/v4l2-compat-ioctl32.c as well! */
#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
#endif /* __LINUX_VIDEODEV2_H */