From nobody@FreeBSD.org  Mon Oct  9 00:24:12 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9FD0516A407
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  9 Oct 2006 00:24:12 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C263443D70
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  9 Oct 2006 00:24:09 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k990O9SX045591
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 9 Oct 2006 00:24:09 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k990O9a8045590;
	Mon, 9 Oct 2006 00:24:09 GMT
	(envelope-from nobody)
Message-Id: <200610090024.k990O9a8045590@www.freebsd.org>
Date: Mon, 9 Oct 2006 00:24:09 GMT
From: Vladimir Kushnir<vkushnir@i.kiev.ua>
To: freebsd-gnats-submit@FreeBSD.org
Subject: (patch) Enable MMX and video grabbing for ffmpeg-devel on amd64
X-Send-Pr-Version: www-3.0

>Number:         104189
>Category:       ports
>Synopsis:       (patch) Enable MMX and video grabbing for ffmpeg-devel on amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 09 00:30:22 GMT 2006
>Closed-Date:    Mon Apr 02 15:18:17 GMT 2007
>Last-Modified:  Mon Apr 02 15:18:17 GMT 2007
>Originator:     Vladimir Kushnir
>Release:        -CURRENT
>Organization:
BITP
>Environment:
FreeBSD kushnir1.kiev.ua 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Tue Oct  3 09:42:01 EEST 2006     root@kushnir1.kiev.ua:/usr/obj/usr/src/sys/KUSHNIR  amd64
>Description:
Both MMX and video (bktr) grabbing in multimedia/ffmpeg-devel are marked as i386 only while both features can be enabled for amd64 as well. Patch against current port is attached. 
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -cr ffmpeg-devel.orig/Makefile ffmpeg-devel/Makefile
*** ffmpeg-devel.orig/Makefile	Mon Oct  9 01:36:11 2006
--- ffmpeg-devel/Makefile	Mon Oct  9 02:27:43 2006
***************
*** 105,111 ****
  ##
  ## arch detection
  ##
! .if ${ARCH} != "i386"
  WITHOUT_MMX=	yes
  .else
  #EXTRA_PATCHES+=	${FILESDIR}/extra-bktr-patch-libavformat::Makefile
--- 105,111 ----
  ##
  ## arch detection
  ##
! .if (${ARCH} != "i386") && (${ARCH} != "amd64") 
  WITHOUT_MMX=	yes
  .else
  #EXTRA_PATCHES+=	${FILESDIR}/extra-bktr-patch-libavformat::Makefile
***************
*** 115,121 ****
  WITH_BUILTIN_VECTOR=	yes
  .endif
  # !i386 does not like bktr
! .if ${ARCH} != "i386"
  CONFIGURE_ARGS+=	--disable-bktr
  .endif
  
--- 115,121 ----
  WITH_BUILTIN_VECTOR=	yes
  .endif
  # !i386 does not like bktr
! .if (${ARCH} != "i386") && (${ARCH} != "amd64")
  CONFIGURE_ARGS+=	--disable-bktr
  .endif
  
***************
*** 443,449 ****
  	@${ECHO_MSG} 'Define WITH_XVID to enable XVID codec'
  	@${ECHO_MSG}
  .endif
! .if ${ARCH} == "i386"
  . ifndef(WITH_VIDEO_CAPTURE)
  	@${ECHO_MSG} 'Define WITH_VIDEO_CAPTURE to enable bktr(4) driver'
  	@${ECHO_MSG} 'video capture'
--- 443,449 ----
  	@${ECHO_MSG} 'Define WITH_XVID to enable XVID codec'
  	@${ECHO_MSG}
  .endif
! .if (${ARCH} == "i386") || (${ARCH} == "amd64")
  . ifndef(WITH_VIDEO_CAPTURE)
  	@${ECHO_MSG} 'Define WITH_VIDEO_CAPTURE to enable bktr(4) driver'
  	@${ECHO_MSG} 'video capture'
***************
*** 489,495 ****
  		-e 's|^(texi2html=)no|\1yes|' \
  		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
  .endif
! .if ${ARCH} == "i386"
  .ifdef(WITH_VIDEO_CAPTURE)
  # set proper audio device
  .ifdef(WITH_AUDIO_DEV)
--- 489,495 ----
  		-e 's|^(texi2html=)no|\1yes|' \
  		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
  .endif
! .if (${ARCH} == "i386") || (${ARCH} == "amd64")
  .ifdef(WITH_VIDEO_CAPTURE)
  # set proper audio device
  .ifdef(WITH_AUDIO_DEV)
***************
*** 500,511 ****
  .ifdef(WITH_BKTR_DEV)
  	@${REINPLACE_CMD} -E \
  		-e "s!idev = 0!idev = ${WITH_BKTR_DEV}!" \
! 		${WRKSRC}/libavformat/grab_bsdbktr.c
  .endif
  .ifdef(WITH_BKTR_FORMAT)
  	@${REINPLACE_CMD} -E \
  		-e "s!VIDEO_FORMAT NTSC!VIDEO_FORMAT ${WITH_BKTR_FORMAT}!" \
! 		${WRKSRC}/libavformat/grab_bsdbktr.c
  .endif
  .endif # WITH_VIDEO_CAPTURE
  .endif # ${ARCH} == i386
--- 500,511 ----
  .ifdef(WITH_BKTR_DEV)
  	@${REINPLACE_CMD} -E \
  		-e "s!idev = 0!idev = ${WITH_BKTR_DEV}!" \
! 		${WRKSRC}/libavformat/grab_bktr.c
  .endif
  .ifdef(WITH_BKTR_FORMAT)
  	@${REINPLACE_CMD} -E \
  		-e "s!VIDEO_FORMAT NTSC!VIDEO_FORMAT ${WITH_BKTR_FORMAT}!" \
! 		${WRKSRC}/libavformat/grab_bktr.c
  .endif
  .endif # WITH_VIDEO_CAPTURE
  .endif # ${ARCH} == i386
Only in ffmpeg-devel/files: patch-libavformat::grab_bktr.c

>Release-Note:
>Audit-Trail:

From: Vladimir Kushnir <vkushnir@i.kiev.ua>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/104189: (patch) Enable MMX and video grabbing for ffmpeg-devel on amd64
Date: Mon, 9 Oct 2006 03:40:51 +0300

 I'm very sorry, did not check a patch twice (after 3 AM L-( ). Here's 
 one-liner
 patch-libavformat::grab_bktr.c:
 
 *** libavformat/grab_bktr.c.orig	Mon Oct  9 03:26:52 2006
 --- libavformat/grab_bktr.c	Mon Oct  9 03:27:07 2006
 ***************
 *** 23,29 ****
    */
   #include "avformat.h"
   #if defined(__FreeBSD__)
 ! # if __FreeBSD__ >= 502100
   #  include <dev/bktr/ioctl_meteor.h>
   #  include <dev/bktr/ioctl_bt848.h>
   # else
 --- 23,29 ----
    */
   #include "avformat.h"
   #if defined(__FreeBSD__)
 ! # if __FreeBSD_version >= 502100
   #  include <dev/bktr/ioctl_meteor.h>
   #  include <dev/bktr/ioctl_bt848.h>
   # else
Class-Changed-From-To: maintainer-update->change-request 
Class-Changed-By: edwin 
Class-Changed-When: Mon Oct 9 11:15:58 UTC 2006 
Class-Changed-Why:  
Fix category (submitter is not maintainer) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104189 
Responsible-Changed-From-To: freebsd-ports-bugs->lioux 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Oct 9 11:16:18 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104189 
Responsible-Changed-From-To: lioux->freebsd-multimedia 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Mar 31 07:19:12 UTC 2007 
Responsible-Changed-Why:  
Maintainership was transferred. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104189 
State-Changed-From-To: open->closed  
State-Changed-By: ahze 
State-Changed-When: Mon Apr 2 15:16:38 UTC 2007 
State-Changed-Why:  
MMX in ffmpeg is now auto-detected, thanks! 

bktr video is out of sync from the latest ffmpeg, patches are welcome! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104189 
>Unformatted:
