mirror of
https://github.com/patjak/facetimehd.git
synced 2026-04-09 11:02:31 +02:00
Merge pull request #77 from tecnickcom/master
fix compile errors in Ubuntu 16.04
This commit is contained in:
3
Makefile
3
Makefile
@@ -1,7 +1,10 @@
|
||||
facetimehd-objs := fthd_ddr.o fthd_hw.o fthd_drv.o fthd_ringbuf.o fthd_isp.o fthd_v4l2.o fthd_buffer.o fthd_debugfs.o
|
||||
obj-m := facetimehd.o
|
||||
|
||||
KVERSION := $(KERNELRELEASE)
|
||||
ifeq ($(origin KERNELRELEASE), undefined)
|
||||
KVERSION := $(shell uname -r)
|
||||
endif
|
||||
KDIR := /lib/modules/$(KVERSION)/build
|
||||
PWD := $(shell pwd)
|
||||
|
||||
|
||||
7
dkms.conf
Normal file
7
dkms.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
PACKAGE_NAME=facetimehd
|
||||
PACKAGE_VERSION=0.1
|
||||
CLEAN="make clean"
|
||||
BUILT_MODULE_NAME[0]="facetimehd"
|
||||
BUILT_MODULE_LOCATION[0]="."
|
||||
DEST_MODULE_LOCATION[0]="/extra"
|
||||
AUTOINSTALL="yes"
|
||||
@@ -1,12 +1,12 @@
|
||||
SHELL = /bin/bash
|
||||
|
||||
DMG:=osxupd10.11.2.dmg
|
||||
DMG:=osxupd10.11.3.dmg
|
||||
OSX_DRV:=AppleCameraInterface
|
||||
OSX_DRV_DIR:=System/Library/Extensions/AppleCameraInterface.kext/Contents/MacOS
|
||||
|
||||
RANGE:=420107885-421933300
|
||||
RANGE:=187085540-191012220
|
||||
|
||||
URL:=https://support.apple.com/downloads/DL1849/en_US/$(DMG)
|
||||
URL:=https://support.apple.com/downloads/DL1858/en_US/$(DMG)
|
||||
FILE:=$(OSX_DRV_DIR)/$(OSX_DRV)
|
||||
|
||||
ifneq ("$(wildcard /usr/lib/firmware)", "")
|
||||
|
||||
@@ -12,6 +12,7 @@ hash_drv_wnd_138='7044344593bfc08ab9b41ab691213bca568c8d924d0e05136b537f66b3c46f
|
||||
hash_drv_osx_140='387097b5133e980196ac51504a60ae1ad8bab736eb0070a55774925ca0194892'
|
||||
hash_drv_osx_143_1='4667e6828f6bfc690a39cf9d561369a525f44394f48d0a98d750931b2f3f278b'
|
||||
hash_drv_osx_143_2='d4650346c940dafdc50e5fcbeeeffe074ec359726773e79c0cfa601cec6b1f08'
|
||||
hash_drv_osx_143_3='dfac86799c6cf0aceb59bb4e732be8f030e7943eb1146830c7136f62621c9853'
|
||||
|
||||
hash_fw_wnd_105='dabb8cf8e874451ebc85c51ef524bd83ddfa237c9ba2e191f8532b896594e50e'
|
||||
hash_fw_wnd_138='ed75dc37b1a0e19949e9e046a629cb55deb6eec0f13ba8fd8dd49b5ccd5a800e'
|
||||
@@ -25,6 +26,7 @@ declare -A known_hashes=(
|
||||
["$hash_drv_osx_140"]='OS X, El Capitan'
|
||||
["$hash_drv_osx_143_1"]='OS X, El Capitan'
|
||||
["$hash_drv_osx_143_2"]='OS X, El Capitan 10.11.2'
|
||||
["$hash_drv_osx_143_3"]='OS X, El Capitan 10.11.3'
|
||||
)
|
||||
|
||||
# Offset in bytes of the firmware inside the driver
|
||||
@@ -34,6 +36,7 @@ declare -A firmw_offsets=(
|
||||
["$hash_drv_osx_140"]=81920
|
||||
["$hash_drv_osx_143_1"]=81920
|
||||
["$hash_drv_osx_143_2"]=81920
|
||||
["$hash_drv_osx_143_3"]=81920
|
||||
)
|
||||
|
||||
# Size in bytes of the firmware inside the driver
|
||||
@@ -43,6 +46,7 @@ declare -A firmw_sizes=(
|
||||
["$hash_drv_osx_140"]=603715
|
||||
["$hash_drv_osx_143_1"]=603715
|
||||
["$hash_drv_osx_143_2"]=603715
|
||||
["$hash_drv_osx_143_3"]=603715
|
||||
)
|
||||
|
||||
# Compression method used to store the firmware inside the driver
|
||||
@@ -52,6 +56,7 @@ declare -A compression=(
|
||||
["$hash_drv_osx_140"]='gzip'
|
||||
["$hash_drv_osx_143_1"]='gzip'
|
||||
["$hash_drv_osx_143_2"]='gzip'
|
||||
["$hash_drv_osx_143_3"]='gzip'
|
||||
)
|
||||
|
||||
declare -A firmw_hashes=(
|
||||
@@ -231,7 +236,7 @@ decompress_dmg()
|
||||
7z e -y "${_main_dir}/$1" "5.hfs" > /dev/null
|
||||
|
||||
msg2 "Extracting update package..."
|
||||
tail -c +189001729 "5.hfs" | head -c 1469917156 > OSXUpd.xar
|
||||
tail -c +189001729 "5.hfs" | head -c 661960661 > OSXUpd.xar
|
||||
rm -f "5.hfs"
|
||||
|
||||
msg2 "Uncompressing XAR archive..."
|
||||
@@ -240,10 +245,10 @@ decompress_dmg()
|
||||
|
||||
msg2 "Decoding Payload..."
|
||||
pbzx "OSXUpd"*.pkg"/Payload" > /dev/null
|
||||
rm "OSXUpdCombo10.11.2.pkg/Payload"
|
||||
rm "OSXUpd10.11.3.pkg/Payload"
|
||||
|
||||
msg2 "Decompressing archives..."
|
||||
cd "OSXUpdCombo10.11.2.pkg"
|
||||
cd "OSXUpd10.11.3.pkg"
|
||||
find . -name "Payload.part*.xz" -exec xz --decompress --verbose {} \;
|
||||
cat "Payload.part"* | cpio -id &> /dev/null
|
||||
cp "./System/Library/Extensions/AppleCameraInterface.kext/Contents/MacOS/AppleCameraInterface" \
|
||||
|
||||
27
fthd_v4l2.c
27
fthd_v4l2.c
@@ -22,6 +22,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <media/v4l2-dev.h>
|
||||
#include <media/v4l2-ioctl.h>
|
||||
@@ -40,25 +41,33 @@
|
||||
#define FTHD_MIN_HEIGHT 240
|
||||
#define FTHD_NUM_FORMATS 2 /* NV16 is disabled for now */
|
||||
|
||||
static int fthd_buffer_queue_setup(struct vb2_queue *vq,
|
||||
const struct v4l2_format *fmt,
|
||||
unsigned int *nbuffers, unsigned int *nplanes,
|
||||
unsigned int sizes[], void *alloc_ctxs[])
|
||||
{
|
||||
static int fthd_buffer_queue_setup(
|
||||
struct vb2_queue *vq,
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
|
||||
const struct v4l2_format *fmt,
|
||||
#endif
|
||||
#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
|
||||
const void *parg,
|
||||
#endif
|
||||
unsigned int *nbuffers,
|
||||
unsigned int *nplanes,
|
||||
unsigned int sizes[],
|
||||
void *alloc_ctxs[]
|
||||
) {
|
||||
|
||||
struct fthd_private *dev_priv = vb2_get_drv_priv(vq);
|
||||
struct v4l2_pix_format *cur_fmt = &dev_priv->fmt.fmt;
|
||||
int i, total_size = 0;
|
||||
|
||||
if (*nplanes)
|
||||
return sizes[0] < (cur_fmt->bytesperline * cur_fmt->height) ? -EINVAL : 0;
|
||||
|
||||
*nplanes = dev_priv->fmt.planes;
|
||||
|
||||
if (!*nplanes)
|
||||
return -EINVAL;
|
||||
|
||||
/* FIXME: We assume single plane format here but not below */
|
||||
if (fmt && fmt->fmt.pix.sizeimage <
|
||||
(cur_fmt->bytesperline * cur_fmt->height))
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < *nplanes; i++) {
|
||||
sizes[i] = cur_fmt->sizeimage;
|
||||
alloc_ctxs[i] = dev_priv->alloc_ctx;
|
||||
|
||||
Reference in New Issue
Block a user